Accounts
Accounts are sub-divisions within an organization (e.g., departments, projects, environments). Users and service accounts belong to specific accounts.
The Account Object
{
"id": "acc-prod001",
"name": "Production Environment",
"organization_id": "org-abc123xyz",
"is_default": false,
"is_active": true,
"metadata": {},
"created_at": "2025-09-30T10:00:00Z",
"updated_at": "2025-09-30T10:00:00Z"
}
Attributes
| Attribute | Type | Description |
|---|---|---|
id | string | Unique identifier for the account |
name | string | Human-friendly account name |
organization_id | string | Parent organization ID |
is_default | boolean | Whether this is the default account for new users |
is_active | boolean | Whether the account is active |
metadata | object | Optional metadata (key-value pairs) |
created_at | string | ISO 8601 timestamp of creation |
updated_at | string | ISO 8601 timestamp of last update |
List Accounts
Retrieves a paginated list of accounts in the organization.
GET /accounts
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number |
quantity | integer | 20 | Results per page (max: 100) |
order_by | string | -created_at | Sort field (prefix with - for descending) |
Example Request
curl "https://api.console.solucao42.com.br/accounts?page=1&quantity=20" \
-H "Authorization: HMAC sa_abc123_acc456_xyz:signature" \
-H "x-date: 2025-09-30T12:00:00Z" \
-H "x-nonce: unique-request-id" \
-H "x-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
Example Response
{
"total": 3,
"page": 1,
"results": [
{
"id": "acc-prod001",
"name": "Production",
"organization_id": "org-abc123xyz",
"is_default": false,
"is_active": true,
"metadata": {},
"created_at": "2025-09-30T10:00:00Z",
"updated_at": "2025-09-30T10:00:00Z"
},
{
"id": "acc-staging001",
"name": "Staging",
"organization_id": "org-abc123xyz",
"is_default": false,
"is_active": true,
"metadata": {},
"created_at": "2025-09-29T10:00:00Z",
"updated_at": "2025-09-29T10:00:00Z"
},
{
"id": "acc-dev001",
"name": "Development",
"organization_id": "org-abc123xyz",
"is_default": true,
"is_active": true,
"metadata": {},
"created_at": "2025-09-28T10:00:00Z",
"updated_at": "2025-09-28T10:00:00Z"
}
]
}
Get Account
Retrieves a specific account by ID.
GET /accounts/{id}
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Account ID |
Example Request
curl https://api.console.solucao42.com.br/accounts/acc-prod001 \
-H "Authorization: HMAC sa_abc123_acc456_xyz:signature" \
-H "x-date: 2025-09-30T12:00:00Z" \
-H "x-nonce: unique-request-id" \
-H "x-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
Example Response
{
"id": "acc-prod001",
"name": "Production",
"organization_id": "org-abc123xyz",
"is_default": false,
"is_active": true,
"metadata": {
"environment": "production",
"region": "us-east-1"
},
"created_at": "2025-09-30T10:00:00Z",
"updated_at": "2025-09-30T10:00:00Z"
}
Create Account
Creates a new account within the organization.
POST /accounts
Request Body
{
"name": "Production",
"is_default": false,
"metadata": {
"environment": "production",
"region": "us-east-1"
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Account name |
is_default | boolean | No | Make this the default account (default: false) |
metadata | object | No | Optional metadata |
Example Request
curl -X POST https://api.console.solucao42.com.br/accounts \
-H "Authorization: HMAC sa_abc123_acc456_xyz:signature" \
-H "Content-Type: application/json" \
-H "x-date: 2025-09-30T12:00:00Z" \
-H "x-nonce: unique-request-id" \
-H "x-content-sha256: <body-hash>" \
-d '{
"name": "Production",
"is_default": false
}'
Example Response
{
"id": "acc-prod002",
"name": "Production",
"organization_id": "org-abc123xyz",
"is_default": false,
"is_active": true,
"metadata": {},
"created_at": "2025-09-30T12:00:00Z",
"updated_at": "2025-09-30T12:00:00Z"
}
Update Account
Updates an existing account.
PATCH /accounts/{id}
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Account ID |
Request Body
{
"name": "Production Environment",
"metadata": {
"environment": "production",
"region": "us-east-1",
"cost_center": "12345"
}
}
Example Request
curl -X PATCH https://api.console.solucao42.com.br/accounts/acc-prod001 \
-H "Authorization: HMAC sa_abc123_acc456_xyz:signature" \
-H "Content-Type: application/json" \
-H "x-date: 2025-09-30T12:00:00Z" \
-H "x-nonce: unique-request-id" \
-H "x-content-sha256: <body-hash>" \
-d '{
"name": "Production Environment"
}'
Example Response
{
"id": "acc-prod001",
"name": "Production Environment",
"organization_id": "org-abc123xyz",
"is_default": false,
"is_active": true,
"metadata": {},
"created_at": "2025-09-30T10:00:00Z",
"updated_at": "2025-09-30T12:30:00Z"
}
Delete Account
Deletes an account. Users and service accounts attached to the account must be migrated first.
DELETE /accounts/{id}
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Account ID |
Example Request
curl -X DELETE https://api.console.solucao42.com.br/accounts/acc-old001 \
-H "Authorization: HMAC sa_abc123_acc456_xyz:signature" \
-H "x-date: 2025-09-30T12:00:00Z" \
-H "x-nonce: unique-request-id" \
-H "x-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
Response
204 No Content
Response Codes
| Code | Description |
|---|---|
| 200 | Success |
| 201 | Created |
| 204 | No Content (delete successful) |
| 400 | Invalid request body |
| 401 | Authentication failed |
| 403 | Insufficient permissions |
| 404 | Account not found |
| 422 | Validation error |
Permissions
Required Permissions
| Action | Permission |
|---|---|
| List accounts | accounts:ListAccounts |
| Get account | accounts:GetAccount |
| Create account | accounts:CreateAccount |
| Update account | accounts:UpdateAccount |
| Delete account | accounts:DeleteAccount |
Related Resources
- Users - Manage account members
- Service Accounts - Programmatic access scoped to accounts
- Groups - Permission groups scoped to accounts
Notes
- At least one account must exist in an organization
- The default account cannot be deleted
- Deleting an account requires migrating all users and service accounts first
- Account IDs are included in service account API key prefixes