Skip to content
Connect an agent
Hosting

Point a stable link at one of your diagrams

Points the stable link with this alias at one of your hosted diagrams, making it when you have none of that name.

POST/user/stable-links

TL;DR

QuestionAnswer
What does it do?Point a stable link at one of your diagrams.
What does it take?A JSON body of type SetStableLinkBody.
What does it return?Status 200 with a body of type StableLink.
What can go wrong?400 the alias or the diagram id is not valid; details says why; 401 not signed in; 403 the plan has no room for another stable link (hosting.quota_exceeded, reason stablelinks), an organisation the account belongs to requires its members to publish to its library (orgs.publish_required, with details.organizations), or the request came from an origin that may not make changes; 404 no such diagram; 429 too many requests; 502 the picture could not be copied to the stable link; 503 hosting is not set up on this server. Every failure uses the one error envelope.

What it does

Points the stable link with this alias at one of your hosted diagrams, making it when you have none of that name. Its address, on the CDN host, always shows the diagram it points at now (cached for 60 seconds) and never changes when the link is moved. How many stable links an account keeps depends on its plan. A diagram that is not yours is a 404.

Request body

The body has the type SetStableLinkBody.

FieldTypeRequiredDescription
aliasstringyesThe name of a stable link: lower-case letters and digits in words joined by single hyphens, up to 60 characters. Only you see it; the public address carries a random token instead. at least 1 character; at most 60 characters; pattern ^[a-z0-9]+(?:-[a-z0-9]+)*$.
diagramIdstringyesOne of your hosted diagrams, by its id.

Responses

StatusMeaningBody
200The stable link was moved.StableLink
201The stable link was made.StableLink
400The alias or the diagram id is not valid; details says why.ErrorResponse
401Not signed in.ErrorResponse
403The plan has no room for another stable link (hosting.quota_exceeded, reason stableLinks), an organisation the account belongs to requires its members to publish to its library (orgs.publish_required, with details.organizations), or the request came from an origin that may not make changes.ErrorResponse
404No such diagram.ErrorResponse
429Too many requests.ErrorResponse
502The picture could not be copied to the stable link.ErrorResponse
503Hosting is not set up on this server.ErrorResponse

Response body

A 200 answer has the type StableLink.

FieldTypeRequiredDescription
idstringyesThe handle for managing the stable link (delete). It is not in its address.
aliasstringyesThe name you gave it. Only you see it.
urlstringyesThe public address, on the CDN host. It shows the diagram the stable link points at now (cached for up to 60 seconds) and never changes. Anyone with it can see the picture.
diagramIdstring | nullyesThe diagram it shows now, or null when that diagram was deleted or expired; the address then answers 404 until you point the link at a diagram again.
createdAtintegeryesWhen it was made, in milliseconds since the epoch.
updatedAtintegeryesWhen it was last pointed at a diagram, in milliseconds since the epoch.

See also

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
Tool referenceThe operations as callable tools