Référence technique

Connectez votre application

Identifiants, licences, accès temporaires et exports. Référence technique en anglais.

Parcourir la documentation

Use this API to add and read your organisation’s licences, request temporary access and export its authorisation records. Publishers can also confirm, renew, reject and revoke customer rights. Create an organisation in the workspace, add or accept licences at Add a licence, then create a credential at Credentials.

A declared existing licence requires publisher confirmation. Accepting published terms enables access only when all stated conditions are satisfied. The API does not take payment, deliver content or create a new purchase when you request a token.

Authentication

Send HTTP Basic authentication with your client_id as the username and the credential secret as the password. Credentials belong to an organisation and a licensing environment; use a credential matching the target publisher’s environment. Keep the secret on a trusted server, outside source control and browser code. Credential rotation immediately revokes the previous credential.

Examples use an HTTPS deployment URL. For local testing, set ASSETROUTER_API_URL=http://127.0.0.1:8000. Set ASSETROUTER_CLIENT_ID and ASSETROUTER_CLIENT_SECRET in your local secret configuration; do not paste a real secret into shared examples.

curl --fail-with-body \
  --user "$ASSETROUTER_CLIENT_ID:$ASSETROUTER_CLIENT_SECRET" \
  "$ASSETROUTER_API_URL/api/v1/library"

Sign in through the browser

An agent or application can obtain a credential without anyone copying a secret, in the shape of the OAuth device flow (RFC 8628):

  1. POST /api/v1/sign-in (no authentication, optional body {"environment": "sandbox"}, default live) returns device_code, user_code, verification_uri, verification_uri_complete, expires_in (600 seconds) and interval (5 seconds).
  2. A person opens verification_uri_complete, signs in to the workspace, checks that user_code matches and approves it for an organisation they own or administer.
  3. The client polls POST /api/v1/sign-in/token with {"device_code": "..."}. Until approval it answers HTTP 400 with error set to authorization_pending; after expiry expired_token; for an unknown or already collected code invalid_grant. After approval it answers 200 with client_id and client_secret, once.

The owner's installer starts the flow with {"purpose": "machine"} (default agent). The credential it collects belongs to that machine: it can send the machine's manifest (below) and is refused with 403 and agent_credential_required on every other route here and on OLP /token, while an agent credential sending a manifest gets machine_credential_required.

Each sign-in adds a credential beside the organisation's existing ones, so other agents keep working. Generating credentials in the workspace replaces all of them. The MCP connector uses this flow; see mcp.

All routes below return JSON. Version v1 is part of the URL. Use HTTPS outside local development. These organisation credentials identify the customer organisation; they do not independently attest an individual AI agent’s identity.

Read the library

GET /api/v1/library returns an object containing licenses, an array scoped to the authenticated organisation.

Each entry contains id, publisher, tenant_id, environment, scope_id, label, verification, validity, origin, resource, pattern, publication_id, conditions and valid_until. Verification and validity are separate: publisher confirmation does not remove an expiry or revocation. Use the tenant and resource information from the confirmed licence when requesting access. Treat conditions as licence terms, not as instructions for your application to execute.

Each entry also includes coverage, selected_offer, terms_url, next_step and authorization_required. These fields let an agent discover and explain a recorded licence immediately, including while it awaits confirmation:

  • coverage.resource_url is an individual URL when known; origins and path_pattern describe the publisher's currently asserted coverage. An exact path ends in $; other patterns follow the published RSL path rules.
  • A collection describes coverage, not an inventory of its documents. includes_document_list is false. Obtain individual URLs from the publisher's catalog or your own workflow; AssetRouter does not crawl a collection to invent them.
  • coverage.artifact_sha256 (11/11/2026) is the SHA-256 of the one file an exact licence covers, in lowercase hex, as its owner declared it when publishing, or "" when none was declared. AssetRouter never receives the file, so this is the owner's declaration: hash the copy you fetched and compare. A difference is between you and the owner, who decides any refund; report it with kind: "other" on /api/v1/reports to keep a case number. The same value is on the Grant (GET /api/v1/grants/{id}) and in the signed record of each authorization.
  • selected_offer and terms_url refer to the version accepted with this entry. Review all conditions when overlapping rows impose further restrictions. Published uses alone do not attest that this customer's access is authorized.
  • next_step is await_publisher_confirmation, request_authorization or contact_publisher. It guides the workflow based on the recorded right. Only a successful authorization request decides access to the actual resource and intended use under the current service state.

For a confirmed active right, take tenant_id from the entry and the actual resource URL from coverage.resource_url or the publisher's catalog, then call /api/v1/authorizations with one intended use. On success send Authorization: License <access_token> only to the intended publisher resource server. Do not forward organization credentials to the publisher. The publisher validates the token before returning its content. A refusal is not permission to fetch through another channel.

Add or accept a licence

POST /api/v1/library submits a licence for the authenticated organisation. Required fields are scope_id, publication_id, request_key (a UUID generated by your application), origin and accept_terms: true. Obtain the scope and current publication from the publisher’s connection link and published conditions. Only submit acceptance after the customer has reviewed those conditions.

origin is existing for rights already held, direct for a purchase made directly from the publisher, or acceptance to accept its current offer. Optional fields are customer_reference, note, resource for an individual resource, and pattern / payment_type to select among multiple published offers. Supporting files can be uploaded through the workspace, not this JSON endpoint.

A successful response is HTTP 201 with the library entry. Existing and directly purchased rights await publisher confirmation. Acceptance of a free offer creates the corresponding right immediately; acceptance of a paid offer still awaits confirmation of the direct arrangement. The endpoint does not collect payment.

Reuse the same request_key and request body after an uncertain result. This returns the original entry instead of creating a duplicate. A changed publication requires a fresh review and a new request. Requests for a withdrawn offer are refused.

{
  "scope_id": "PUBLISHED_SCOPE_UUID",
  "publication_id": "REVIEWED_PUBLICATION_UUID",
  "request_key": "CLIENT_GENERATED_UUID",
  "origin": "existing",
  "customer_reference": "order-42",
  "accept_terms": true
}

Confirm customer rights as a publisher

Use credentials for the publisher organisation. GET /api/v1/requests returns its customer requests, including the customer name, reference, note and whether a private supporting document is available in the workspace. It does not expose requests addressed to other publishers.

POST /api/v1/requests/{entry_id} accepts action: confirm, renew, reject or revoke. Confirmation and renewal also require expires_at, an ISO 8601 date and time with timezone, for example 2027-01-31T23:59:59+01:00. This is the agreed expiry of the underlying right, distinct from the shorter token lifetime. The publisher must have completed the required account approval and agreements for live licensing.

Confirmation checks the same publication accepted by the customer. Renewal preserves the previous right in the history and requires a later expiry; changes to published conditions require a new customer acceptance. Revocation prevents further authorisations and causes online validation of affected tokens to fail. It cannot remove copies already delivered by the publisher.

Successful actions return HTTP 200 with the updated entry. Repeating a confirmation or revocation has no additional effect. After an uncertain renewal result, read the entry and compare its expiry before retrying. A request outside the publisher’s organisation or environment returns 404.

Request temporary access

POST /api/v1/authorizations accepts tenant_id, resource and usage. The resource is the URL you intend to access, and the usage must be permitted by the confirmed licence, for example ai-input for use as model input.

curl --fail-with-body \
  --user "$ASSETROUTER_CLIENT_ID:$ASSETROUTER_CLIENT_SECRET" \
  --header 'Content-Type: application/json' \
  --data '{"tenant_id":"PUBLISHER_TENANT_ID","resource":"https://publisher.example/report.pdf","usage":"ai-input"}' \
  "$ASSETROUTER_API_URL/api/v1/authorizations"

Replace the illustrative tenant ID and resource with values covered by your licence. A successful response contains access_token, token_type, expires_in, resource and assetrouter_token_id. expires_in describes the token lifetime in seconds. Present the token to the publisher’s server as required by the resource-server contract. AssetRouter does not fetch the resource for you.

A renewed request may issue another short-lived token. No idempotency header is required for this endpoint: issuance does not create another underlying licence or charge. After an uncertain network outcome, a retry may therefore produce another token and another request record. Never interpret a successful token response as proof that the resource was downloaded.

Read and export records

GET /api/v1/records returns schema, meaning, records and verification_keys. Each record has payload and signature. The response contains only records available to the authenticated organisation. Publishers can also review and export their records through their workspace.

When the publisher declared the SHA-256 fingerprint of the file a token was issued for, the signed payload also carries it as artifact_sha256. Hash your copy of the file and compare: a match shows your copy is the file the publisher declared at that moment. AssetRouter never receives the file, so the fingerprint is the publisher's declaration, not a check made by AssetRouter.

curl --fail-with-body \
  --user "$ASSETROUTER_CLIENT_ID:$ASSETROUTER_CLIENT_SECRET" \
  "$ASSETROUTER_API_URL/api/v1/records" \
  --output assetrouter-records.json

The workspace’s Export licenses and records action also includes frozen licence documents, granted rights and certificates, verification keys, and the private details and supporting files submitted for those licences. Publisher exports include the customer requests addressed to that publisher. Treat the export as confidential.

AssetRouter signs the service records. Keep the verification keys with an export. The record describes a request or authorisation decision, not delivery, a model’s use of content or a third party’s independent confirmation. Downloading an export does not prepare an independent replacement service; that is a separate optional arrangement.

Report a problem

POST /api/v1/reports lets an agent say that something is wrong without a person in between: a licence token that is refused although the right exists, data or a licence used where it should not be, or anything else. Send kind (token_not_working, misuse or other), text (up to 4000 characters) and, optionally, resource_url. The answer is 201 with case_number (for example R-000042) and state. The report belongs to your organisation, names the agent's client_id, is mailed to AssetRouter and appears in the workspace under Reports, where people answer and close it. Never put secrets, passwords or tokens in text: people read it.

curl --fail-with-body \
  --user "$ASSETROUTER_CLIENT_ID:$ASSETROUTER_CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"kind": "token_not_working", "text": "The server answers 401 invalid_token.", "resource_url": "https://publisher.example/report.pdf"}' \
  "$ASSETROUTER_API_URL/api/v1/reports"

GET /api/v1/reports lists the organisation's last 100 reports with case_number, kind, state (open, acknowledged, closed), title and created_at. The answers in each report's history are read in the workspace. A report never blocks or revokes anything by itself. An organisation's agents may open 20 reports an hour; above that the answer is 429 with too_many_reports.

Read the spending cap

GET /api/v1/spending tells the calling agent how much it may still spend (added 11/11/2026). The cap is set per agent by an owner or administrator of your organisation in the workspace, under Connect your agents, for a calendar day, ISO week or month in UTC, in one currency. Your organisation answers for the purchases of its agents.

{
  "organization": "Example Research",
  "agent": 1,
  "cap": {"amount": "1.00", "currency": "USD", "period": "day"},
  "spent": "0.60",
  "remaining": "0.40",
  "period_start": "2026-11-11T00:00:00+00:00",
  "resets_at": "2026-11-12T00:00:00+00:00"
}

agent is the generation of the credential that called; every connector that signs in gets its own, with its own cap. spent counts paid purchases and checkouts still open in the last 24 hours, in the cap's currency. remaining never goes below 0.00, even after a cap is lowered under what was spent. Without a cap the answer is {"organization": ..., "agent": ..., "cap": null} and purchases are not limited on the server. The route is read only: POST, PUT, PATCH and DELETE answer 405, so an agent cannot raise its own cap. A purchase over the cap is refused on /olp/token and /olp/checkout before any payment, with unauthorized_client and assetrouter_reason spending_cap_reached (or spending_cap_currency for a sale in another currency); do not retry it unchanged.

Ask for data you cannot find

POST /api/v1/data-requests tells AssetRouter that your agent looked for data and could not find it (added 11/11/2026). Send description, in plain words and up to 2000 characters (what, how much, in what form), and usage, the intended use: ai-input, ai-index, ai-train or search. The answer is 201 with the request's id and state. AssetRouter looks for an owner who has such data and, when one fits, links the request to that owner's licence: the state becomes matched, and your organisation is told under Reports. Nothing is bought or shared by the request itself, and no owner sees it before AssetRouter has checked that it fits.

curl --fail-with-body   --user "$ASSETROUTER_CLIENT_ID:$ASSETROUTER_CLIENT_SECRET"   -H "Content-Type: application/json"   -d '{"description": "Viscosity of alginate hydrogels, at least 200 samples, CSV", "usage": "ai-train"}'   "$ASSETROUTER_API_URL/api/v1/data-requests"

GET /api/v1/data-requests lists your organisation's last 100 requests in the credential's environment, newest first, with id, description, usage, state, created_at and match (null until a licence is found). Other organisations never see them. A description that is empty or longer than 2000 characters, or a use outside the four, answers 400 with invalid_description_or_usage. An organisation may make 20 requests an hour; above that the answer is 429 with too_many_data_requests.

Send a machine's manifest

POST /api/v1/machine/manifest, with a machine credential, takes the store manifest the installer writes (schema assetrouter.store-manifest.v0: files with name, folder, bytes, modified; folders with folder, dataset_sha256, files, bytes; installer_version, generated_at, links_not_followed) and an optional public_origin, https://host[:port] with no path. It replaces the machine's previous manifest whole and answers 200 with machine, files, folders and received_at. Only metadata are accepted (Terms of 19/11, art. 4 bis): any other field, a name longer than 255 bytes or holding /, a folder leaving the store, a fingerprint that is not 64 hexadecimal characters answers 400 with a reason (unexpected_field, not_a_file_name, not_a_folder, invalid_fingerprint, invalid_number, invalid_date, unknown_schema, invalid_public_origin) and nothing is kept. Up to 20 000 files per manifest; a larger body answers 413 with too_many_files.

Fetch a machine's gate credential

POST /api/v1/machine/gate, with a machine credential and an empty JSON body, answers what the machine's gate needs for the folder the owner put on sale from the panel's selector (19/11/2026): client_id, client_secret, introspection_url, license_url, public_origin, folder and resource_url. The secret is minted for this answer and is not stored or shown anywhere else; asking again issues a new one and ends the previous one at once, so call it right before (re)starting the gate. With no folder on sale it answers 404 with nothing_published, and the gate keeps refusing every protected request. An owner no longer cleared to sell (application not approved, data processing agreement not accepted) answers 403 with owner_not_cleared. For a licence sold from a machine the panel's credential button does not rotate this secret: the machine does, here, so the two never stop each other's gate. The installer does this by itself when it writes gate.env.

Disconnect a machine

POST /api/v1/machine/uninstall, with a machine credential and an empty JSON body, revokes that credential and the credential of its gate, deletes the machine's metadata on the server, and answers 200 with disconnected: true (19/11/2026). The installer's disinstalla calls it before removing the local copy; afterwards the same credential answers 401. The licence of the folder the machine sold stays published until the owner withdraws it.

Errors and retries

Check the HTTP status before using a response. A 4xx response means the request was refused or invalid; inspect its JSON error and correct the cause, such as credentials, resource, usage or licence conditions. Do not repeatedly retry an unchanged refused request. Network errors and 5xx responses can be retried with a bounded delay. A timeout does not prove the original request was rejected.

Existing publisher administration and Open License Protocol integrations remain documented in the licensing API reference. New customer applications should start with the organisation routes above. For AI tooling, the MCP adapter calls the same routes with the same credentials and access rules.