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-linksTL;DR
| Question | Answer |
|---|---|
| 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.
| Field | Type | Required | Description |
|---|---|---|---|
alias | string | yes | The 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]+)*$. |
diagramId | string | yes | One of your hosted diagrams, by its id. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The stable link was moved. | StableLink |
| 201 | The stable link was made. | StableLink |
| 400 | The alias or the diagram id is not valid; details says why. | ErrorResponse |
| 401 | Not signed in. | ErrorResponse |
| 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. | ErrorResponse |
| 404 | No such diagram. | ErrorResponse |
| 429 | Too many requests. | ErrorResponse |
| 502 | The picture could not be copied to the stable link. | ErrorResponse |
| 503 | Hosting is not set up on this server. | ErrorResponse |
Response body
A 200 answer has the type StableLink.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | The handle for managing the stable link (delete). It is not in its address. |
alias | string | yes | The name you gave it. Only you see it. |
url | string | yes | The 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. |
diagramId | string | null | yes | The 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. |
createdAt | integer | yes | When it was made, in milliseconds since the epoch. |
updatedAt | integer | yes | When it was last pointed at a diagram, in milliseconds since the epoch. |
See also
| Doc | Why |
|---|---|
| API reference | Every endpoint, and the error envelope |
| Schemas | Every request and response type |
| Tool reference | The operations as callable tools |