API reference
Bridge local API
How a tool on the same computer as AnimSync Bridge reads and changes projects, with every operation it can ask for.
A tool on the same computer as AnimSync Bridge works with AnimSync through Bridge's local API. It needs no token. The person allows the tool once, in Bridge's window, for the projects and operations they choose. Bridge then forwards each call to the server as that person, and logs it.
Before you start
- Bridge must be running and signed in to the server.
- To change plans and assets, the person must have allowed it when they signed in to the server. A sign-in from before this existed lets tools read and publish only. Choose Sign in again on Bridge's Servers page, and leave Let paired tools change plans and assets ticked.
- The person's role still counts: reading needs a viewer, changing needs a contributor. Fields only a lead may set stay that way.
- A workspace's owners and admins can switch local integrations off, or block one tool.
Where it is
Bridge writes local-api.json into its settings folder: %APPDATA%\AnimSync\Bridge on Windows, ~/Library/Application Support/AnimSync Bridge on macOS, ~/.config/animsync-bridge on Linux. It holds the port and no secrets. Calls go to http://127.0.0.1:<port>/local/v1.
The API answers on this computer only. It refuses a request with an Origin header, so a web page cannot call it.
Pair the tool
- Send
POST /pairwith who you are and what you need. The answer is202with arequestIdand apollSecret. - Bridge shows the request. The person picks the projects, and may allow fewer operations than you asked for.
- Send
GET /pair/<requestId>with the headerx-animsync-poll: <pollSecret>every second or so. Once allowed, it answers with your key, one time. A request waits ten minutes. - Keep the key in your own settings and send
Authorization: Bearer bsk_…with every other call. A401 invalid_keymeans it was revoked: pair again.
{
"id": "acme.houdini-export",
"name": "Acme export tools",
"publisher": "Acme Studio",
"operations": ["projects.list", "requirements.read", "planning.write", "files.publish"]
}
The id is yours: 3 to 80 lower-case letters, digits, dots and dashes. Names starting with animsync. are reserved. To ask for more operations later, pair again.
GET /info needs no key. It tells Bridge's version, whether pairing is possible, and the operations this Bridge knows.
Python
The client that comes with every AnimSync plugin uses only the standard library:
from animsync_core.bridge_client import BridgeClient
client = BridgeClient(key_file="~/.acme/animsync.json")
client.ensure_paired("acme.planner", "Acme planner", "Acme Studio",
["projects.list", "requirements.read", "planning.write", "assets.write"])
walk = client.create_requirement(set_id, "Walk", category="locomotion", targetFrames=32)
client.update_requirement(walk["id"], walk["revision"], name="Walk forward")
clip = client.create_asset("GAME", "AS_Walk")
client.link_asset(walk["id"], clip["id"])
call(method, path, body, revision) reaches any operation on this page.
Operations
| Operation | The person allows the tool to |
|---|---|
projects.list | see which projects you are in |
tasks.mine | read your tasks |
requirements.read | read animation sets and requirements |
planning.read | read characters, skeletons, core poses, tags and the rest of the plan |
planning.write | change the plan: characters, animation sets, requirements, relationships, poses and tags |
assets.read | read assets and their versions |
assets.write | create, change and archive assets, and link them to requirements |
versions.download | download version files |
files.publish | publish files |
captures.upload | upload runtime captures |
events.subscribe | be told what happens in a project (new versions, review decisions, finished automation) |
Parameters in an address: :code is a project code, :id and anything ending in Id is an id. Bodies and answers are the server's own, so fields links to where they are described. An operation marked If-Match needs the revision you last read.
projects.list
The person is asked to let the tool see which projects you are in.
| Call | What it does | Details |
|---|---|---|
GET /projects | The projects this tool may use, on every server it is paired for. | - |
tasks.mine
The person is asked to let the tool read your tasks.
| Call | What it does | Details |
|---|---|---|
GET /tasks/mine | The person's own tasks in those projects. | - |
requirements.read
The person is asked to let the tool read animation sets and requirements.
| Call | What it does | Details |
|---|---|---|
GET /projects/:code/sets | The project's animation sets. | - |
GET /sets/:id/requirements | An animation set's requirements, relationships and poses. | - |
GET /requirements/:id | One requirement. | - |
GET /projects/:code/requirements | The project's requirements, across its sets. | fields |
GET /sets/:id | One animation set. | fields |
GET /requirements/:id/fulfilments | The assets linked to a requirement. | fields |
GET /relationships/:id | One relationship. | fields |
planning.read
The person is asked to let the tool read characters, skeletons, core poses, tags and the rest of the plan.
| Call | What it does | Details |
|---|---|---|
GET /projects/:code/characters | The project's characters. | fields |
GET /characters/:id | One character. | fields |
GET /characters/:id/sets | A character's animation sets, in order. | fields |
GET /characters/:id/planning | A character's whole plan: every set's requirements, relationships and poses. | fields |
GET /projects/:code/skeletons | The project's skeletons. | fields |
GET /projects/:code/core-poses | The project's core poses and what is linked to them. | fields |
GET /projects/:code/milestones | The project's milestones. | fields |
GET /projects/:code/tags | The project's tags, with how often each is used. | fields |
GET /projects/:code/tag-assignments | Which item has which tag. | fields |
GET /projects/:code/external-ids | The ids other programs know items by. | query: source, kind, externalId, subjectId, includeArchived, cursor, limit; fields |
GET /projects/:code/depth-axes | The project's depth axes (stances, gaits) and their depths. | fields |
GET /requirements/:id/depth-coverage | What a state machine has at each depth. | query: characterId; fields |
GET /projects/:code/archived-planning | Archived relationships and core poses that can be restored. | fields |
planning.write
The person is asked to let the tool change the plan: characters, animation sets, requirements, relationships, poses and tags.
| Call | What it does | Details |
|---|---|---|
POST /projects/:code/skeletons | Create a skeleton. | fields |
PATCH /skeletons/:id | Change a skeleton. | If-Match; fields |
POST /skeletons/:id/archive | Archive a skeleton. | If-Match; fields |
POST /skeletons/:id/restore | Restore a skeleton that was archived. | If-Match; fields |
POST /projects/:code/characters | Create a character. | fields |
PATCH /characters/:id | Change a character. | If-Match; fields |
POST /characters/:id/archive | Archive a character. | If-Match; fields |
POST /characters/:id/restore | Restore a character that was archived. | If-Match; fields |
PUT /characters/:id/sets/:setId | Give a character an animation set, or move it in the order. | fields |
DELETE /characters/:id/sets/:setId | Take an animation set off a character. The set itself stays. | fields |
POST /projects/:code/sets | Create an animation set. | fields |
PATCH /sets/:id | Change an animation set. | If-Match; fields |
POST /sets/:id/archive | Archive an animation set. | If-Match; fields |
POST /sets/:id/restore | Restore an animation set that was archived. | If-Match; fields |
POST /sets/:id/requirements | Create a requirement in an animation set. | fields |
PATCH /requirements/:id | Change a requirement. | If-Match; fields |
POST /requirements/:id/move | Move a requirement to another animation set. | If-Match; fields |
POST /requirements/:id/archive | Archive a requirement. | If-Match; fields |
POST /requirements/:id/restore | Restore a requirement that was archived. | If-Match; fields |
POST /relationships | Create a relationship between two requirements. | fields |
PATCH /relationships/:id | Change a relationship. | If-Match; fields |
POST /relationships/:id/archive | Archive a relationship. | If-Match; fields |
POST /relationships/:id/restore | Restore a relationship that was archived. | If-Match; fields |
POST /projects/:code/core-poses | Create a core pose shared by the whole project. | fields |
POST /sets/:id/core-poses | Create a core pose in an animation set. | fields |
PATCH /core-poses/:id | Change a core pose. | If-Match; fields |
POST /core-poses/:id/archive | Archive a core pose. | If-Match; fields |
POST /core-poses/:id/restore | Restore a core pose that was archived. | If-Match; fields |
POST /requirements/:id/poses | Link a core pose to a requirement. | fields |
DELETE /requirements/:id/poses/:corePoseId/:role | Unlink a core pose from a requirement. | fields |
POST /requirements/:id/blendspace-samples | Add a sample to a blendspace. | fields |
PATCH /blendspace-samples/:id | Move a blendspace sample. | If-Match; fields |
POST /blendspace-samples/:id/archive | Archive a blendspace sample. | If-Match; fields |
POST /blendspace-samples/:id/restore | Restore a blendspace sample that was archived. | If-Match; fields |
POST /requirements/:id/collection-members | Add an animation to a collection. | fields |
POST /collection-members/:id/archive | Take an animation out of a collection. | If-Match; fields |
POST /collection-members/:id/restore | Put an animation back into a collection. | If-Match; fields |
POST /requirements/:id/states | Add a state to a state machine. | fields |
PATCH /states/:id | Change a state. | If-Match; fields |
POST /states/:id/archive | Archive a state. | If-Match; fields |
POST /states/:id/restore | Restore a state that was archived. | If-Match; fields |
POST /requirements/:id/state-transitions | Add a transition to a state machine. | fields |
PATCH /state-transitions/:id | Change a state transition. | If-Match; fields |
POST /state-transitions/:id/archive | Archive a state transition. | If-Match; fields |
POST /state-transitions/:id/restore | Restore a state transition that was archived. | If-Match; fields |
POST /projects/:code/layer-interfaces | Create a layer interface. | fields |
PATCH /layer-interfaces/:id | Change a layer interface. | If-Match; fields |
POST /layer-interfaces/:id/archive | Archive a layer interface. | If-Match; fields |
POST /layer-interfaces/:id/restore | Restore a layer interface that was archived. | If-Match; fields |
POST /layer-interfaces/:id/slots | Add a slot to a layer interface. | fields |
PATCH /layer-slots/:id | Change a layer slot. | If-Match; fields |
POST /layer-slots/:id/archive | Archive a layer slot. | If-Match; fields |
POST /layer-slots/:id/restore | Restore a layer slot that was archived. | If-Match; fields |
PUT /characters/:id/depth-levels/:levelId | Say whether a character has a depth. | fields |
POST /projects/:code/depth-axes | Create a depth axis (stances, gaits). | fields |
PATCH /depth-axes/:id | Change a depth axis. | If-Match; fields |
POST /depth-axes/:id/archive | Archive a depth axis. | If-Match; fields |
POST /depth-axes/:id/restore | Restore a depth axis that was archived. | If-Match; fields |
POST /depth-axes/:id/levels | Add a depth to an axis. | fields |
PATCH /depth-levels/:id | Change a depth. | If-Match; fields |
POST /depth-levels/:id/archive | Archive a depth. | If-Match; fields |
POST /depth-levels/:id/restore | Restore a depth that was archived. | If-Match; fields |
POST /requirements/:id/depth-marks | Mark a state or an animation as not used at a depth. | fields |
POST /depth-marks/:id/archive | Archive a depth mark. | If-Match; fields |
POST /depth-marks/:id/restore | Restore a depth mark that was archived. | If-Match; fields |
POST /projects/:code/tags | Create a tag. | fields |
PATCH /projects/:code/tags/:tagId | Change a tag. | fields |
PUT /projects/:code/tags/:tagId/assignments/:entityType/:entityId | Put a tag on an item. | fields |
DELETE /projects/:code/tags/:tagId/assignments/:entityType/:entityId | Take a tag off an item. | fields |
PUT /characters/:id/external-ids/:source | Set the id another program knows a character by. | fields |
DELETE /characters/:id/external-ids/:source | Forget the id another program knows a character by. | fields |
PUT /sets/:id/external-ids/:source | Set the id another program knows an animation set by. | fields |
DELETE /sets/:id/external-ids/:source | Forget the id another program knows an animation set by. | fields |
PUT /requirements/:id/external-ids/:source | Set the id another program knows a requirement by. | fields |
DELETE /requirements/:id/external-ids/:source | Forget the id another program knows a requirement by. | fields |
assets.read
The person is asked to let the tool read assets and their versions.
| Call | What it does | Details |
|---|---|---|
GET /projects/:code/assets | The project's assets. | - |
GET /assets/:id/versions | An asset's versions, newest first. | - |
GET /assets/:id | One asset, with the requirements it fulfils. | fields |
GET /assets/:id/relations | What an asset depends on and what depends on it. | fields |
assets.write
The person is asked to let the tool create, change and archive assets, and link them to requirements.
| Call | What it does | Details |
|---|---|---|
POST /projects/:code/assets | Create an asset without a file. To publish a file, use files.publish. | fields |
PATCH /assets/:id | Change an asset. | If-Match; fields |
POST /assets/:id/archive | Archive an asset. | If-Match; fields |
POST /assets/:id/restore | Restore an asset that was archived. | If-Match; fields |
PUT /requirements/:id/fulfilments/:assetId | Link an asset to a requirement, or change the link. | fields |
DELETE /requirements/:id/fulfilments/:assetId | Unlink an asset from a requirement. | fields |
PUT /assets/:id/core-pose-links/:corePoseId | Link an asset to a core pose. | fields |
DELETE /assets/:id/core-pose-links/:corePoseId | Unlink an asset from a core pose. | query: relation; fields |
PUT /assets/:id/external-ids/:source | Set the id another program knows an asset by. | fields |
DELETE /assets/:id/external-ids/:source | Forget the id another program knows an asset by. | fields |
versions.download
The person is asked to let the tool download version files.
| Call | What it does | Details |
|---|---|---|
GET /versions/:id/source | A version's source file. List the asset's versions first. | - |
files.publish
The person is asked to let the tool publish files.
| Call | What it does | Details |
|---|---|---|
POST /files/publish | Publish a file as a new version of an asset. The body is the file. | query: project, asset, asset_id, filename, comment, kind, fulfils, ticket, source_path, source_revision, derived_from, version_id |
captures.upload
The person is asked to let the tool upload runtime captures.
| Call | What it does | Details |
|---|---|---|
POST /captures | Start a runtime capture: the body is its header. | query: project |
PUT /captures/:id/chunks/:n | Send one chunk of a capture. The body is the chunk file. | - |
POST /captures/:id/complete | Finish a capture. The server then checks it against the plan. | - |
events.subscribe
The person is asked to let the tool be told what happens in a project (new versions, review decisions, finished automation).
| Call | What it does | Details |
|---|---|---|
GET /projects/:code/events | What happened in the project after event number after, oldest first. | query: after, limit |
Several servers
When a tool is paired on more than one server, add ?server=<address> to say which one. Every forwarded answer names the server it came from in the x-animsync-server header.
Errors
An error is { "error": "<code>", "message": "…", "details"?: …, "server"?: … }. The server's own codes pass through with their status, such as 409 revision_conflict (see the overview). These are Bridge's:
| Status | Code | Meaning |
|---|---|---|
| 401 | invalid_key | The key is missing or was revoked. Pair again |
| 403 | operation_not_allowed | The tool was not paired for this operation |
| 403 | project_not_allowed | The tool was not paired for this project |
| 403 | server_not_allowed | The tool was not paired for this server |
| 403 | token_paused | The tools of this sign-in archived or changed too much in a few minutes. A project admin lets it continue in the project settings |
| 403 | connection_ended | An admin ended this sign-in's access to the project |
| 403 | local_integrations_off | The workspace switched local integrations off |
| 403 | integration_blocked | The workspace blocked this tool |
| 409 | sign_in_again | Bridge's sign-in to the server ended |
| 409 | edit_consent_required | The sign-in lets tools read and publish only. Sign in again to allow changes |
| 409 | server_update_needed | The server is older than this operation |
| 428 | precondition_required | Send If-Match with the revision you read |
| 429 | rate_limited | More than 10 requests a second. Retry-After says when to try again |
| 429 | upload_quota | More than 1 GB uploaded in an hour |
| 502 | server_unreachable | The server did not answer |