Organizations
Manage your organization settings and team members. All API requests are scoped to a single organization based on the authenticated user’s membership.
Get Current Organization
/api/v1/organizationsRetrieve the current organization's details.
Returns the organization associated with the current authentication context, including settings, plan, and usage.
curl -X GET "https://api.orderly-hub.com/api/v1/organizations" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "X-Organization-Id: your-org-id"Response
{
"data": {
"id": "uuid",
"name": "Acme Fulfillment",
"slug": "acme-fulfillment",
"plan": "pro",
"settings": {
"timezone": "America/New_York",
"default_currency": "USD"
},
"created_at": "2025-06-01T00:00:00Z"
}
}Update Current Organization
/api/v1/organizationsUpdate the current organization's settings.
Updates the organization’s name, settings, or other configurable properties. Only users with the Admin or Owner role can update the organization.
Request Body
| Field | Type | Description |
|---|---|---|
name | string | Organization display name |
settings | object | Organization-wide settings |
curl -X PATCH "https://api.orderly-hub.com/api/v1/organizations" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "X-Organization-Id: your-org-id" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Fulfillment Inc.",
"settings": { "timezone": "America/Los_Angeles" }
}'List Members
/api/v1/organizations/membersList all members of the current organization.
Returns all users who are members of the current organization, including their roles.
curl -X GET "https://api.orderly-hub.com/api/v1/organizations/members" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "X-Organization-Id: your-org-id"Response
{
"data": [
{
"id": "uuid",
"first_name": "Jane",
"last_name": "Doe",
"email": "jane@acme.com",
"role": "owner",
"created_at": "2025-06-01T00:00:00Z"
},
{
"id": "uuid",
"first_name": "Bob",
"last_name": "Smith",
"email": "bob@acme.com",
"role": "member",
"created_at": "2025-07-15T00:00:00Z"
}
]
}Invite Member
/api/v1/organizations/members/inviteSend an email invitation to join the organization.
Creates a pending invitation and sends a branded email via Resend with a link to accept. Invitations expire after 7 days.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Email address to invite |
role | string | No | Role to assign: member (default), organization_manager, manager |
curl -X POST "https://api.orderly-hub.com/api/v1/organizations/members/invite" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "X-Organization-Id: your-org-id" \
-H "Content-Type: application/json" \
-d '{
"email": "alice@acme.com",
"role": "member"
}'Response (201)
{
"data": {
"id": "uuid",
"email": "alice@acme.com",
"role": "member",
"expiresAt": "2026-03-29T00:00:00Z"
}
}Errors
| Status | Description |
|---|---|
| 409 | User is already a member of this organization |
| 409 | A pending invitation already exists for this email |
List Pending Invitations
/api/v1/organizations/members/invitationsList all pending invitations for the current organization.
Returns invitations with status = 'pending' for the current organization.
curl -X GET "https://api.orderly-hub.com/api/v1/organizations/members/invitations" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "X-Organization-Id: your-org-id"Response
{
"data": [
{
"id": "uuid",
"email": "alice@acme.com",
"role": "member",
"status": "pending",
"invited_by": "uuid",
"expires_at": "2026-03-29T00:00:00Z",
"created_at": "2026-03-22T00:00:00Z"
}
]
}Accept Invitation
/api/v1/organizations/members/invite/:token/acceptAccept a pending invitation.
Validates the invitation token, verifies the logged-in user’s email matches, creates an organization_members row, and marks the invitation as accepted.
curl -X POST "https://api.orderly-hub.com/api/v1/organizations/members/invite/abc123token/accept" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."Response
{
"data": {
"organizationId": "uuid",
"role": "member"
}
}Errors
| Status | Description |
|---|---|
| 404 | Invitation not found or already used |
| 410 | Invitation has expired |
| 403 | Email mismatch — invitation was sent to a different email |
Revoke Invitation
/api/v1/organizations/members/invite/:idRevoke a pending invitation.
Sets the invitation status to revoked. The invite link will no longer work.
curl -X DELETE "https://api.orderly-hub.com/api/v1/organizations/members/invite/invitation-uuid" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "X-Organization-Id: your-org-id"Response
{
"success": true
}Remove Member
/api/v1/organizations/members/:userIdRemove a member from the organization.
Removes the user from the organization. Cannot remove the organization owner.
curl -X DELETE "https://api.orderly-hub.com/api/v1/organizations/members/user-uuid" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "X-Organization-Id: your-org-id"Response
{
"success": true
}