Service Accounts
Create a Service Account
API Documentation
Governance
- Organisations
- Schemes
- Work Orders
- Permits
- Operations
- Properties
- Streets
Data Capture
- Forms
- Form Categories
- Submissions
- Submission Versions
Operations
- Reinstatements
Assets
- Vehicles
Admin
Service Accounts
Create a Service Account
Use this endpoint to create a new service account.
POST
/
v3
/
orgs
/
{orgId}
/
iam
/
service-accounts
curl --request POST \
--url https://api.ctrl-hub.com/v3/orgs/{orgId}/iam/service-accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"data": {
"type": "service-accounts",
"attributes": {
"name": "ACME Corp",
"description": "This service account is for integrating with ACME Corp",
"enabled": true
}
}
}'
{
"data": {
"type": "service-accounts",
"id": "14b28316-9c20-8a7d-e85a-b62f29a29ac5",
"attributes": {
"name": "ACME Corp",
"description": "This service account is for integrating with ACME Corp",
"enabled": true,
"email": "acmecorp@7e0c875a-fd47-401d-bd25-4278ed58d721.iam.ctrl-hub.com"
},
"meta": {
"created_at": "2024-10-14T17:03:06.204Z"
},
"relationships": {
"keys": {
"data": [
{
"type": "service-account-keys",
"id": "4c9d6aa9-f658-4e9e-8510-39d05a574018"
}
]
}
}
}
}
Authorizations
To understand how to authenticate, see the auth docs
Body
application/json
The type of resource
Available options:
organisations
Example:
"service-accounts"
Response
200
application/json
Available options:
service-accounts
Example:
"service-accounts"
Example:
"14b28316-9c20-8a7d-e85a-b62f29a29ac5"
The role name
Example:
"ACME Corp"
A description for the service account
Example:
"This service account is for integrating with ACME Corp"
Whether the service account is enabled or not
Example:
true
A system generated email address for the service account, comprising of the service account ID and the IAM domain
Example:
"acmecorp@7e0c875a-fd47-401d-bd25-4278ed58d721.iam.ctrl-hub.com"
curl --request POST \
--url https://api.ctrl-hub.com/v3/orgs/{orgId}/iam/service-accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"data": {
"type": "service-accounts",
"attributes": {
"name": "ACME Corp",
"description": "This service account is for integrating with ACME Corp",
"enabled": true
}
}
}'
{
"data": {
"type": "service-accounts",
"id": "14b28316-9c20-8a7d-e85a-b62f29a29ac5",
"attributes": {
"name": "ACME Corp",
"description": "This service account is for integrating with ACME Corp",
"enabled": true,
"email": "acmecorp@7e0c875a-fd47-401d-bd25-4278ed58d721.iam.ctrl-hub.com"
},
"meta": {
"created_at": "2024-10-14T17:03:06.204Z"
},
"relationships": {
"keys": {
"data": [
{
"type": "service-account-keys",
"id": "4c9d6aa9-f658-4e9e-8510-39d05a574018"
}
]
}
}
}
}