The Space Members API enables you to manage user access to a space—a shared environment within the Aimable Platform. This domain allows you to invite users, manage memberships, accept invitations, and control access rights programmatically. It's essential for building collaboration features, automating team onboarding, or integrating with external identity systems.
Key Concepts
Space: A logical container for collaboration. Identified by a space_id (UUID).
Member: A user who has joined the space. Represented by a principal_id (UUID).
Invite: A time-limited token granting access to join a space. Can be created, updated, accepted, or revoked.
Principal: A user or service identity in the system, identified globally by principal_id.
Authentication is required for all endpoints using a Bearer token in the Authorization header. Optional X-API-Key header may be used for additional identification.
How to Use the API
1. Invite a User to a Space
Creates an invite for a specific user (principal_id) to join a space.
POST /api-proxy/v1/spaces/{space_id}/invites/{invite_id}/accept
Verify membership:
GET /api-proxy/v1/spaces/{space_id}/members
Alternatively, if you have admin rights and want to add directly without an invite:
POST /api-proxy/v1/spaces/{space_id}/members{ "principal_id": "..." }
Authentication & Error Handling
All endpoints require authentication via:
Authorization: Bearer <access_token>
Optional:
X-API-Key: <api_key>
Common Errors
| Status | Meaning |
|-------|--------|
| 401 | Missing or invalid access token |
| 403 | Authenticated but not authorized (e.g., not a space admin) |
| 422 | Invalid input (e.g., malformed UUID, missing field) |
Example 422 response:
{ "detail": [ { "loc": ["body", "principal_id"], "msg": "Input should be a valid UUID", "type": "uuid_type", "input": "not-a-uuid" } ]}
Ensure proper validation of space_id, invite_id, and principal_id as UUIDs before making requests.
Use this API to build dynamic access control, team management dashboards, or automated provisioning flows. Always validate responses and handle revocation or expiration of invites appropriately.