Aller au contenu principal

Enrollment

9 routes de l'API publique. Textes de la source : openapi-csp.json du dépôt platform.

List enrollment tokens​

GET /enrollment-tokens

Accès : Clé API du MSP, portée read.

Paramètres

NomEmplacementTypeObligatoireDescription
limitrequêteintegernonDéfaut : 50. Valeur : 1 à 100.
cursorrequêtestringnonLongueur minimum : 1.
client_idrequêtestring (uuid)non
statusrequête"pending" | "used" | "revoked" | "expired"non
originrequête"portal" | "mcp"non
used_by_endpoint_idrequêtestring (uuid)nonOnly the token that enrolled this endpoint. With origin=mcp: the endpoint page shows its restore quarantine.

Réponses

CodeDescription
200Success
defaultError (400, 401, 403, 404, 409, 415, 422, 429, 500, 502, 503 or 504)

Réponse 200 (application/json)

NomTypeObligatoireDescription
itemsarray of objectoui
items[].idstring (uuid)oui
items[].client_idstring (uuid)oui
items[].type"agent" | "m365"oui
items[].endpoint_idstring (uuid) | nullouiReattach token: its agent endpoint. Null: the token enrolls a new endpoint.
items[].status"pending" | "used" | "revoked" | "expired"ouipending: can still enroll. A used token stays used, even if revoked later.
items[].created_atstring (date-time)oui
items[].expires_atstring (date-time)oui
items[].used_atstring (date-time) | nulloui
items[].used_by_endpoint_idstring (uuid) | nulloui
items[].revoked_atstring (date-time) | nulloui
items[].tagsarray of objectouiTags the token gives to the endpoint it enrolls, by key. A used token keeps the tags it gave.
items[].origin"portal" | "mcp"ouiportal: made in the portal (or with an API key). mcp: made by an AI assistant with an MCP access
items[].oauth_client_idstring (uuid) | nullouimcp token: the OAuth client of the MCP access. Null otherwise.
items[].oauth_client_namestring | nullouimcp token: the name the OAuth client gave at its registration (RFC 7591 client_name), for example Claude. Text of the client, not checked: show it as text. Null for a portal token or a client without a name.
items[].created_bystring (uuid) | nullouiThe user who made the token (for an mcp token, the person of the MCP access)
items[].restore_quarantine_untilstring (date-time) | nullouiUsed mcp token: until then, its endpoint is no restore target for an MCP access, unless a person approves it in the portal (POST /endpoints/:id/mcp-approval). Null: no quarantine (any other token, approved, or over)
items[].restore_approved_atstring (date-time) | nullouiUsed mcp token: when a person approved its endpoint as a restore target.
next_cursorstring | nulloui

Create enrollment token​

POST /enrollment-tokens

Accès : Clé API du MSP, portée operate.

Corps de la requête (application/json)

NomTypeObligatoireDescription
client_idstring (uuid)ouiClient of the caller's MSP, else 404.
type"agent" | "m365"nonType of the endpoint the token enrolls.
tagsarray of objectnonagent token only: tags the enrolled endpoint gets. Éléments maximum : 20.
tags[].keystringouiLongueur : 1 à 64.
tags[].valuestringouiLongueur : 1 à 128.

Réponses

CodeDescription
201Success
defaultError (400, 401, 403, 404, 409, 415, 422, 429, 500, 502, 503 or 504)

Réponse 201 (application/json)

NomTypeObligatoireDescription
idstring (uuid)oui
client_idstring (uuid)oui
type"agent" | "m365"oui
endpoint_idstring (uuid) | nullouiReattach token (POST /endpoints/:id/reattach-token): the agent endpoint it gives back to its machine. Null: the token enrolls a new endpoint.
tokenstringoui
expires_atstring (date-time)ouiCreation + 7 days; with an MCP access, creation + 1 h (MCP_ENROLLMENT_TOKEN_TTL_S, fixed)
install_commandstring | nullouiagent token: one-liner to paste as root: downloads the agent, installs the systemd unit, runs baastide agent enroll. The token is passed as BAASTIDE_ENROLL_TOKEN on the sh command only, never in argv. Null for an m365 token.
install_command_windowsstring | nullouiagent token: PowerShell one-liner to paste in an elevated PowerShell (Windows): downloads the agent, installs the Windows service, runs baastide agent enroll. The token is set in BAASTIDE_ENROLL_TOKEN of the session, never in argv; the installer removes it. Null for an m365 token.
tagsarray of objectouiStored tags of the token, by key, in the form the endpoint will get. Not in the install commands.
tags[].key_idstring (uuid)oui
tags[].keystringoui
tags[].valuestringoui

Revoke enrollment token​

DELETE /enrollment-tokens/{id}

Accès : Clé API du MSP, portée operate.

Paramètres

NomEmplacementTypeObligatoireDescription
idcheminstring (uuid)oui

Réponses

CodeDescription
200Success
defaultError (400, 401, 403, 404, 409, 415, 422, 429, 500, 502, 503 or 504)

Réponse 200 (application/json)

NomTypeObligatoireDescription
idstring (uuid)oui
client_idstring (uuid)oui
type"agent" | "m365"oui
endpoint_idstring (uuid) | nullouiReattach token: its agent endpoint. Null: the token enrolls a new endpoint.
status"pending" | "used" | "revoked" | "expired"ouipending: can still enroll. A used token stays used, even if revoked later.
created_atstring (date-time)oui
expires_atstring (date-time)oui
used_atstring (date-time) | nulloui
used_by_endpoint_idstring (uuid) | nulloui
revoked_atstring (date-time) | nulloui
tagsarray of objectouiTags the token gives to the endpoint it enrolls, by key. A used token keeps the tags it gave.
tags[].key_idstring (uuid)oui
tags[].keystringoui
tags[].valuestringoui
origin"portal" | "mcp"ouiportal: made in the portal (or with an API key). mcp: made by an AI assistant with an MCP access
oauth_client_idstring (uuid) | nullouimcp token: the OAuth client of the MCP access. Null otherwise.
oauth_client_namestring | nullouimcp token: the name the OAuth client gave at its registration (RFC 7591 client_name), for example Claude. Text of the client, not checked: show it as text. Null for a portal token or a client without a name.
created_bystring (uuid) | nullouiThe user who made the token (for an mcp token, the person of the MCP access)
restore_quarantine_untilstring (date-time) | nullouiUsed mcp token: until then, its endpoint is no restore target for an MCP access, unless a person approves it in the portal (POST /endpoints/:id/mcp-approval). Null: no quarantine (any other token, approved, or over)
restore_approved_atstring (date-time) | nullouiUsed mcp token: when a person approved its endpoint as a restore target.

Set enrollment token tags​

PUT /enrollment-tokens/{id}/tags

Accès : Clé API du MSP, portée operate.

Paramètres

NomEmplacementTypeObligatoireDescription
idcheminstring (uuid)oui

Corps de la requête (application/json)

NomTypeObligatoireDescription
tagsarray of objectouiÉléments maximum : 20.
tags[].keystringouiLongueur : 1 à 64.
tags[].valuestringouiLongueur : 1 à 128.

Réponses

CodeDescription
200Success
defaultError (400, 401, 403, 404, 409, 415, 422, 429, 500, 502, 503 or 504)

Réponse 200 (application/json)

NomTypeObligatoireDescription
idstring (uuid)oui
client_idstring (uuid)oui
type"agent" | "m365"oui
endpoint_idstring (uuid) | nullouiReattach token: its agent endpoint. Null: the token enrolls a new endpoint.
status"pending" | "used" | "revoked" | "expired"ouipending: can still enroll. A used token stays used, even if revoked later.
created_atstring (date-time)oui
expires_atstring (date-time)oui
used_atstring (date-time) | nulloui
used_by_endpoint_idstring (uuid) | nulloui
revoked_atstring (date-time) | nulloui
tagsarray of objectouiTags the token gives to the endpoint it enrolls, by key. A used token keeps the tags it gave.
tags[].key_idstring (uuid)oui
tags[].keystringoui
tags[].valuestringoui
origin"portal" | "mcp"ouiportal: made in the portal (or with an API key). mcp: made by an AI assistant with an MCP access
oauth_client_idstring (uuid) | nullouimcp token: the OAuth client of the MCP access. Null otherwise.
oauth_client_namestring | nullouimcp token: the name the OAuth client gave at its registration (RFC 7591 client_name), for example Claude. Text of the client, not checked: show it as text. Null for a portal token or a client without a name.
created_bystring (uuid) | nullouiThe user who made the token (for an mcp token, the person of the MCP access)
restore_quarantine_untilstring (date-time) | nullouiUsed mcp token: until then, its endpoint is no restore target for an MCP access, unless a person approves it in the portal (POST /endpoints/:id/mcp-approval). Null: no quarantine (any other token, approved, or over)
restore_approved_atstring (date-time) | nullouiUsed mcp token: when a person approved its endpoint as a restore target.

List deployment tokens​

GET /deployment-tokens

Accès : Clé API du MSP, portée read.

Paramètres

NomEmplacementTypeObligatoireDescription
limitrequêteintegernonDéfaut : 50. Valeur : 1 à 100.
cursorrequêtestringnonLongueur minimum : 1.
client_idrequêtestring (uuid)non
statusrequête"active" | "exhausted" | "revoked" | "expired"non

Réponses

CodeDescription
200Success
defaultError (400, 401, 403, 404, 409, 415, 422, 429, 500, 502, 503 or 504)

Réponse 200 (application/json)

NomTypeObligatoireDescription
itemsarray of objectoui
items[].idstring (uuid)oui
items[].client_idstring (uuid)oui
items[].kind"deployment"oui
items[].status"active" | "exhausted" | "revoked" | "expired"oui
items[].max_usesinteger | nullouiNull: no limit.
items[].use_countintegerouiMachines enrolled with the token. Never above max_uses, also with many enrollments at the same time. Valeur minimum : 0.
items[].allowed_cidrsarray of string (cidrv4) | string (cidrv6)oui
items[].tagsarray of objectouiTags each enrolled endpoint gets, by key.
items[].created_atstring (date-time)oui
items[].created_bystring (uuid) | nullouiThe user who made the token. Null: the user was deleted.
items[].expires_atstring (date-time)oui
items[].revoked_atstring (date-time) | nulloui
items[].last_used_atstring (date-time) | nullouiLast enrollment with the token. Null: never used.
next_cursorstring | nulloui

Get deployment token​

GET /deployment-tokens/{id}

Accès : Clé API du MSP, portée read.

Paramètres

NomEmplacementTypeObligatoireDescription
idcheminstring (uuid)oui

Réponses

CodeDescription
200Success
defaultError (400, 401, 403, 404, 409, 415, 422, 429, 500, 502, 503 or 504)

Réponse 200 (application/json)

NomTypeObligatoireDescription
idstring (uuid)oui
client_idstring (uuid)oui
kind"deployment"oui
status"active" | "exhausted" | "revoked" | "expired"oui
max_usesinteger | nullouiNull: no limit.
use_countintegerouiMachines enrolled with the token. Never above max_uses, also with many enrollments at the same time. Valeur minimum : 0.
allowed_cidrsarray of string (cidrv4) | string (cidrv6)oui
tagsarray of objectouiTags each enrolled endpoint gets, by key.
tags[].key_idstring (uuid)oui
tags[].keystringoui
tags[].valuestringoui
created_atstring (date-time)oui
created_bystring (uuid) | nullouiThe user who made the token. Null: the user was deleted.
expires_atstring (date-time)oui
revoked_atstring (date-time) | nulloui
last_used_atstring (date-time) | nullouiLast enrollment with the token. Null: never used.

List deployment token endpoints​

GET /deployment-tokens/{id}/endpoints

Accès : Clé API du MSP, portée read.

Paramètres

NomEmplacementTypeObligatoireDescription
idcheminstring (uuid)oui
limitrequêteintegernonDéfaut : 50. Valeur : 1 à 100.
cursorrequêtestringnonLongueur minimum : 1.

Réponses

CodeDescription
200Success
defaultError (400, 401, 403, 404, 409, 415, 422, 429, 500, 502, 503 or 504)

Réponse 200 (application/json)

NomTypeObligatoireDescription
itemsarray of objectoui
items[].endpoint_idstring (uuid)oui
items[].namestringouiHostname at enrollment.
items[].display_namestring | nulloui
items[].status"active" | "deleted"oui
items[].machine_idstring | nullouiNull: the agent did not send one.
items[].source_ipstring (ipv4) | string (ipv6) | nullouiAddress the enrollment came from. Null: unknown.
items[].enrolled_atstring (date-time)oui
next_cursorstring | nulloui

Create reattach token​

POST /endpoints/{id}/reattach-token

Accès : Clé API du MSP, portée operate.

Paramètres

NomEmplacementTypeObligatoireDescription
idcheminstring (uuid)oui

Réponses

CodeDescription
201Success
defaultError (400, 401, 403, 404, 409, 415, 422, 429, 500, 502, 503 or 504)

Réponse 201 (application/json)

NomTypeObligatoireDescription
idstring (uuid)oui
client_idstring (uuid)oui
type"agent" | "m365"oui
endpoint_idstring (uuid) | nullouiReattach token (POST /endpoints/:id/reattach-token): the agent endpoint it gives back to its machine. Null: the token enrolls a new endpoint.
tokenstringoui
expires_atstring (date-time)ouiCreation + 7 days; with an MCP access, creation + 1 h (MCP_ENROLLMENT_TOKEN_TTL_S, fixed)
install_commandstring | nullouiagent token: one-liner to paste as root: downloads the agent, installs the systemd unit, runs baastide agent enroll. The token is passed as BAASTIDE_ENROLL_TOKEN on the sh command only, never in argv. Null for an m365 token.
install_command_windowsstring | nullouiagent token: PowerShell one-liner to paste in an elevated PowerShell (Windows): downloads the agent, installs the Windows service, runs baastide agent enroll. The token is set in BAASTIDE_ENROLL_TOKEN of the session, never in argv; the installer removes it. Null for an m365 token.
tagsarray of objectouiStored tags of the token, by key, in the form the endpoint will get. Not in the install commands.
tags[].key_idstring (uuid)oui
tags[].keystringoui
tags[].valuestringoui

Get install profile​

GET /install-profile

Accès : Clé API du MSP, portée read.

Réponses

CodeDescription
200Success
defaultError (400, 401, 403, 404, 409, 415, 422, 429, 500, 502, 503 or 504)

Réponse 200 (application/json)

NomTypeObligatoireDescription
profile_idstring (uuid) | nullouiPublic id of the profile, in the install URLs. Not a secret, gives no right. Null: no saved profile, the BaaStide profile applies.
profileobjectouiThe saved profile, or the BaaStide profile (revision 0) when profile_id is null.
profile.productNamestringouiLongueur : 1 à 64.
profile.publisherstringouiLongueur : 1 à 64.
profile.shortNamestringoui
profile.serviceNamestringoui
profile.serviceDescriptionstringouiLongueur : 0 à 256.
profile.supportUrlstringnonLongueur maximum : 2048.
profile.publicHoststringnonLongueur maximum : 253.
profile.revisionintegerouiValeur minimum : 0.
install_url_linuxstringouiURL of install.sh that the install command of an agent token fetches.
install_url_windowsstringouiURL of install.ps1 that the Windows install command fetches.
updated_atstring (date-time) | nullouiLast change; null without a saved profile.
platform_hoststringouiHost of the platform URL (PUBLIC_URL): the target of the CNAME of profile.publicHost. Never a request header.