UDFs
A UDF record holds the Python source (udf_body), a slug, and its placement on a canvas. These endpoints manage the records; to execute a UDF see Running UDFs.
The UDF object
| Field | Type | Description |
|---|---|---|
id | string | UDF id |
slug | string | URL-safe name, unique within a canvas |
udf_body | string | The UDF source and metadata |
collection_id | string | null | Canvas the UDF belongs to |
collection_name | string | null | Canvas name |
is_visible | boolean | Whether the UDF is shown on its canvas |
position | integer | Ordering on the canvas |
udf_body_hash | string | Hash of udf_body, for change detection |
last_updated | string | Last modification timestamp |
owning_user | object | null | Owner summary |
List your UDFs
GET /udf/self
Scope: user
Query parameters
| Parameter | Type | Description |
|---|---|---|
skip | integer | Offset. Default 0. |
limit | integer | Page size. Default 300. |
List your team's UDFs
GET /udf/exec-env/self
Scope: environment
Every UDF in your execution environment. Accepts the same query parameters. This is the listing to use with a service account token.
Get a UDF
GET /udf/by-id/{udf_id}
Scope: public or authorized — public UDFs are readable with no credentials; private ones require access.
Returns the UDF object.
By name
Several addressing schemes resolve a UDF without knowing its id:
| Endpoint | Scope | Resolves |
|---|---|---|
GET /udf/exec-env/self/by-collection/{canvas_name}/by-slug/{slug} | environment | A UDF on one of your team's canvases |
GET /udf/by-user-handle/{handle}/by-collection/{canvas_name}/by-slug/{slug} | user or environment | A UDF owned by a user, addressed by handle |
GET /udf/by-user-email/{email}/by-collection/{canvas_name}/by-slug/{slug} | user or environment | The same, addressed by email |
Each has a variant without /by-collection/{canvas_name} that resolves the slug on the owner's default canvas.
By shared token
GET /udf/shared/by-token/{token}
Scope: by token.
Returns the UDF a shared token points at. This is how fused.load("fsh_…") resolves a token to code.
Create a UDF
POST /udf/new
Scope: user
Body
| Field | Type | Required | Description |
|---|---|---|---|
slug | string | Yes | URL-safe name |
udf_body | string | Yes | The UDF source and metadata |
udf_type | string | Yes | Use auto |
collection_id | string | No | Canvas to add the UDF to |
create_shared_token | boolean | No | Also mint a shared token. Default false. |
shared_token_access_scope | string | No | public or team. Default team. |
Returns the created UDF object; when create_shared_token is true it also includes shared_token.
Update a UDF
POST /udf/by-id/{udf_id}
Scope: user
Send only the fields you want to change: slug, udf_body, or collection_id. Returns the updated UDF object.
Delete a UDF
DELETE /udf/by-id/{udf_id}
Scope: user
Deleting a UDF breaks any shared token or URL pointing at it. Cached results are not served after deletion.
See also
- Running UDFs — executing what you create here
- Canvases — the canvas a UDF belongs to
- Write UDFs securely — access control and sharing