For Developers
Create Service Account
POST https://ed.link/api/v2/teams/:team_id/service_accounts
Creates a service-account user, a membership, and an initial token. The token secret is tokens[].value on the returned membership.
Permissions
Requires either the tokens.create or tokens.update system permission.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
:team_id | UUID | Yes | The ID of the team. |
Request Body
| Property | Type | Required | Description |
|---|---|---|---|
name | String | No | Display name stored as the service user's first_name. Defaults to Service Account. |
Sample Request
const response = await axios.post(
`https://ed.link/api/v2/teams/${team_id}/service_accounts`,
{
name: 'Backend Sync Worker'
},
{
headers: {
authorization: `Bearer ${user_session_token}`,
'content-type': 'application/json'
}
}
);
Sample Response
{
"$data": {
"id": "8b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"created_date": "2024-06-21T12:00:00.000Z",
"state": "active",
"user": {
"first_name": "Backend Sync Worker",
"type": "service"
},
"tokens": [
{
"id": "3b7d4bad-9bdd-2b0d-7b3d-cb6d9b1deb4d",
"value": "a1b2c3d4e5f6",
"state": "active"
}
]
}
}
