Docs

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

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

  1. Send POST /pair with who you are and what you need. The answer is 202 with a requestId and a pollSecret.
  2. Bridge shows the request. The person picks the projects, and may allow fewer operations than you asked for.
  3. Send GET /pair/<requestId> with the header x-animsync-poll: <pollSecret> every second or so. Once allowed, it answers with your key, one time. A request waits ten minutes.
  4. Keep the key in your own settings and send Authorization: Bearer bsk_… with every other call. A 401 invalid_key means 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

OperationThe person allows the tool to
projects.listsee which projects you are in
tasks.mineread your tasks
requirements.readread animation sets and requirements
planning.readread characters, skeletons, core poses, tags and the rest of the plan
planning.writechange the plan: characters, animation sets, requirements, relationships, poses and tags
assets.readread assets and their versions
assets.writecreate, change and archive assets, and link them to requirements
versions.downloaddownload version files
files.publishpublish files
captures.uploadupload runtime captures
events.subscribebe 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.

CallWhat it doesDetails
GET /projectsThe 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.

CallWhat it doesDetails
GET /tasks/mineThe person's own tasks in those projects.-

requirements.read

The person is asked to let the tool read animation sets and requirements.

CallWhat it doesDetails
GET /projects/:code/setsThe project's animation sets.-
GET /sets/:id/requirementsAn animation set's requirements, relationships and poses.-
GET /requirements/:idOne requirement.-
GET /projects/:code/requirementsThe project's requirements, across its sets.fields
GET /sets/:idOne animation set.fields
GET /requirements/:id/fulfilmentsThe assets linked to a requirement.fields
GET /relationships/:idOne relationship.fields

planning.read

The person is asked to let the tool read characters, skeletons, core poses, tags and the rest of the plan.

CallWhat it doesDetails
GET /projects/:code/charactersThe project's characters.fields
GET /characters/:idOne character.fields
GET /characters/:id/setsA character's animation sets, in order.fields
GET /characters/:id/planningA character's whole plan: every set's requirements, relationships and poses.fields
GET /projects/:code/skeletonsThe project's skeletons.fields
GET /projects/:code/core-posesThe project's core poses and what is linked to them.fields
GET /projects/:code/milestonesThe project's milestones.fields
GET /projects/:code/tagsThe project's tags, with how often each is used.fields
GET /projects/:code/tag-assignmentsWhich item has which tag.fields
GET /projects/:code/external-idsThe ids other programs know items by.query: source, kind, externalId, subjectId, includeArchived, cursor, limit; fields
GET /projects/:code/depth-axesThe project's depth axes (stances, gaits) and their depths.fields
GET /requirements/:id/depth-coverageWhat a state machine has at each depth.query: characterId; fields
GET /projects/:code/archived-planningArchived 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.

CallWhat it doesDetails
POST /projects/:code/skeletonsCreate a skeleton.fields
PATCH /skeletons/:idChange a skeleton.If-Match; fields
POST /skeletons/:id/archiveArchive a skeleton.If-Match; fields
POST /skeletons/:id/restoreRestore a skeleton that was archived.If-Match; fields
POST /projects/:code/charactersCreate a character.fields
PATCH /characters/:idChange a character.If-Match; fields
POST /characters/:id/archiveArchive a character.If-Match; fields
POST /characters/:id/restoreRestore a character that was archived.If-Match; fields
PUT /characters/:id/sets/:setIdGive a character an animation set, or move it in the order.fields
DELETE /characters/:id/sets/:setIdTake an animation set off a character. The set itself stays.fields
POST /projects/:code/setsCreate an animation set.fields
PATCH /sets/:idChange an animation set.If-Match; fields
POST /sets/:id/archiveArchive an animation set.If-Match; fields
POST /sets/:id/restoreRestore an animation set that was archived.If-Match; fields
POST /sets/:id/requirementsCreate a requirement in an animation set.fields
PATCH /requirements/:idChange a requirement.If-Match; fields
POST /requirements/:id/moveMove a requirement to another animation set.If-Match; fields
POST /requirements/:id/archiveArchive a requirement.If-Match; fields
POST /requirements/:id/restoreRestore a requirement that was archived.If-Match; fields
POST /relationshipsCreate a relationship between two requirements.fields
PATCH /relationships/:idChange a relationship.If-Match; fields
POST /relationships/:id/archiveArchive a relationship.If-Match; fields
POST /relationships/:id/restoreRestore a relationship that was archived.If-Match; fields
POST /projects/:code/core-posesCreate a core pose shared by the whole project.fields
POST /sets/:id/core-posesCreate a core pose in an animation set.fields
PATCH /core-poses/:idChange a core pose.If-Match; fields
POST /core-poses/:id/archiveArchive a core pose.If-Match; fields
POST /core-poses/:id/restoreRestore a core pose that was archived.If-Match; fields
POST /requirements/:id/posesLink a core pose to a requirement.fields
DELETE /requirements/:id/poses/:corePoseId/:roleUnlink a core pose from a requirement.fields
POST /requirements/:id/blendspace-samplesAdd a sample to a blendspace.fields
PATCH /blendspace-samples/:idMove a blendspace sample.If-Match; fields
POST /blendspace-samples/:id/archiveArchive a blendspace sample.If-Match; fields
POST /blendspace-samples/:id/restoreRestore a blendspace sample that was archived.If-Match; fields
POST /requirements/:id/collection-membersAdd an animation to a collection.fields
POST /collection-members/:id/archiveTake an animation out of a collection.If-Match; fields
POST /collection-members/:id/restorePut an animation back into a collection.If-Match; fields
POST /requirements/:id/statesAdd a state to a state machine.fields
PATCH /states/:idChange a state.If-Match; fields
POST /states/:id/archiveArchive a state.If-Match; fields
POST /states/:id/restoreRestore a state that was archived.If-Match; fields
POST /requirements/:id/state-transitionsAdd a transition to a state machine.fields
PATCH /state-transitions/:idChange a state transition.If-Match; fields
POST /state-transitions/:id/archiveArchive a state transition.If-Match; fields
POST /state-transitions/:id/restoreRestore a state transition that was archived.If-Match; fields
POST /projects/:code/layer-interfacesCreate a layer interface.fields
PATCH /layer-interfaces/:idChange a layer interface.If-Match; fields
POST /layer-interfaces/:id/archiveArchive a layer interface.If-Match; fields
POST /layer-interfaces/:id/restoreRestore a layer interface that was archived.If-Match; fields
POST /layer-interfaces/:id/slotsAdd a slot to a layer interface.fields
PATCH /layer-slots/:idChange a layer slot.If-Match; fields
POST /layer-slots/:id/archiveArchive a layer slot.If-Match; fields
POST /layer-slots/:id/restoreRestore a layer slot that was archived.If-Match; fields
PUT /characters/:id/depth-levels/:levelIdSay whether a character has a depth.fields
POST /projects/:code/depth-axesCreate a depth axis (stances, gaits).fields
PATCH /depth-axes/:idChange a depth axis.If-Match; fields
POST /depth-axes/:id/archiveArchive a depth axis.If-Match; fields
POST /depth-axes/:id/restoreRestore a depth axis that was archived.If-Match; fields
POST /depth-axes/:id/levelsAdd a depth to an axis.fields
PATCH /depth-levels/:idChange a depth.If-Match; fields
POST /depth-levels/:id/archiveArchive a depth.If-Match; fields
POST /depth-levels/:id/restoreRestore a depth that was archived.If-Match; fields
POST /requirements/:id/depth-marksMark a state or an animation as not used at a depth.fields
POST /depth-marks/:id/archiveArchive a depth mark.If-Match; fields
POST /depth-marks/:id/restoreRestore a depth mark that was archived.If-Match; fields
POST /projects/:code/tagsCreate a tag.fields
PATCH /projects/:code/tags/:tagIdChange a tag.fields
PUT /projects/:code/tags/:tagId/assignments/:entityType/:entityIdPut a tag on an item.fields
DELETE /projects/:code/tags/:tagId/assignments/:entityType/:entityIdTake a tag off an item.fields
PUT /characters/:id/external-ids/:sourceSet the id another program knows a character by.fields
DELETE /characters/:id/external-ids/:sourceForget the id another program knows a character by.fields
PUT /sets/:id/external-ids/:sourceSet the id another program knows an animation set by.fields
DELETE /sets/:id/external-ids/:sourceForget the id another program knows an animation set by.fields
PUT /requirements/:id/external-ids/:sourceSet the id another program knows a requirement by.fields
DELETE /requirements/:id/external-ids/:sourceForget the id another program knows a requirement by.fields

assets.read

The person is asked to let the tool read assets and their versions.

CallWhat it doesDetails
GET /projects/:code/assetsThe project's assets.-
GET /assets/:id/versionsAn asset's versions, newest first.-
GET /assets/:idOne asset, with the requirements it fulfils.fields
GET /assets/:id/relationsWhat 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.

CallWhat it doesDetails
POST /projects/:code/assetsCreate an asset without a file. To publish a file, use files.publish.fields
PATCH /assets/:idChange an asset.If-Match; fields
POST /assets/:id/archiveArchive an asset.If-Match; fields
POST /assets/:id/restoreRestore an asset that was archived.If-Match; fields
PUT /requirements/:id/fulfilments/:assetIdLink an asset to a requirement, or change the link.fields
DELETE /requirements/:id/fulfilments/:assetIdUnlink an asset from a requirement.fields
PUT /assets/:id/core-pose-links/:corePoseIdLink an asset to a core pose.fields
DELETE /assets/:id/core-pose-links/:corePoseIdUnlink an asset from a core pose.query: relation; fields
PUT /assets/:id/external-ids/:sourceSet the id another program knows an asset by.fields
DELETE /assets/:id/external-ids/:sourceForget the id another program knows an asset by.fields

versions.download

The person is asked to let the tool download version files.

CallWhat it doesDetails
GET /versions/:id/sourceA version's source file. List the asset's versions first.-

files.publish

The person is asked to let the tool publish files.

CallWhat it doesDetails
POST /files/publishPublish 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.

CallWhat it doesDetails
POST /capturesStart a runtime capture: the body is its header.query: project
PUT /captures/:id/chunks/:nSend one chunk of a capture. The body is the chunk file.-
POST /captures/:id/completeFinish 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).

CallWhat it doesDetails
GET /projects/:code/eventsWhat 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:

StatusCodeMeaning
401invalid_keyThe key is missing or was revoked. Pair again
403operation_not_allowedThe tool was not paired for this operation
403project_not_allowedThe tool was not paired for this project
403server_not_allowedThe tool was not paired for this server
403token_pausedThe tools of this sign-in archived or changed too much in a few minutes. A project admin lets it continue in the project settings
403connection_endedAn admin ended this sign-in's access to the project
403local_integrations_offThe workspace switched local integrations off
403integration_blockedThe workspace blocked this tool
409sign_in_againBridge's sign-in to the server ended
409edit_consent_requiredThe sign-in lets tools read and publish only. Sign in again to allow changes
409server_update_neededThe server is older than this operation
428precondition_requiredSend If-Match with the revision you read
429rate_limitedMore than 10 requests a second. Retry-After says when to try again
429upload_quotaMore than 1 GB uploaded in an hour
502server_unreachableThe server did not answer