Documentation Index Fetch the complete documentation index at: https://docs.docinject.com/llms.txt
Use this file to discover all available pages before exploring further.
Use the organization endpoints to list and manage the members of your organization, control role assignments, organize members into departments, and issue API keys for programmatic access. All endpoints require a valid Bearer token in the Authorization header.
Base URL: https://api.docinject.io/api/v1
List organizations
Retrieve all organizations the authenticated user belongs to.
curl https://api.docinject.io/api/v1/organizations \
-H "Authorization: Bearer <token>"
Response 200
[
{
"id" : "org-3f2a1b4c-8e7d-4f6a-9b0c-1d2e3f4a5b6c" ,
"name" : "Acme Corp" ,
"slug" : "acme-corp"
}
]
Get the current organization
Return the organization associated with the authenticated token.
curl https://api.docinject.io/api/v1/organizations/me \
-H "Authorization: Bearer <token>"
Response 200
{
"id" : "org-3f2a1b4c-8e7d-4f6a-9b0c-1d2e3f4a5b6c" ,
"name" : "Acme Corp" ,
"slug" : "acme-corp"
}
Update organization name
Update the display name of an organization. Requires admin role.
PATCH /organizations/{org_id}
Path parameters
The UUID of the organization to update.
Body
The new display name for the organization.
curl -X PATCH https://api.docinject.io/api/v1/organizations/org-3f2a1b4c \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"name": "Acme Corporation"}'
Response 200
{
"id" : "org-3f2a1b4c-8e7d-4f6a-9b0c-1d2e3f4a5b6c" ,
"name" : "Acme Corporation" ,
"slug" : "acme-corp"
}
List members
Return all members of an organization, including their profile and role.
GET /organizations/{org_id}/members
Path parameters
The UUID of the organization.
curl https://api.docinject.io/api/v1/organizations/org-3f2a1b4c/members \
-H "Authorization: Bearer <token>"
Response 200 — array of member objects
Unique user identifier (UUID).
The user’s display name. May be null if not set; fall back to email.
The user’s email address.
URL to the user’s avatar image. May be null.
The member’s role in the organization. One of admin or member.
ISO 8601 timestamp of when the user joined the organization.
[
{
"user" : {
"id" : "usr-a1b2c3d4-e5f6-7890-abcd-ef1234567890" ,
"display_name" : "Jordan Lee" ,
"email" : "jordan@acme-corp.com" ,
"avatar_url" : "https://cdn.docinject.io/avatars/usr-a1b2c3d4.png"
},
"role" : "admin" ,
"joined_at" : "2024-01-10T09:00:00Z"
},
{
"user" : {
"id" : "usr-b2c3d4e5-f6a7-8901-bcde-f12345678901" ,
"display_name" : null ,
"email" : "sam@acme-corp.com" ,
"avatar_url" : null
},
"role" : "member" ,
"joined_at" : "2024-02-14T14:30:00Z"
}
]
Get member count
Return the total number of members in an organization.
GET /organizations/{org_id}/members/count
Path parameters
The UUID of the organization.
curl https://api.docinject.io/api/v1/organizations/org-3f2a1b4c/members/count \
-H "Authorization: Bearer <token>"
Response 200
The total number of members currently in the organization.
Invite a member
Send an invitation email to a new member. Requires admin role. Fires the member.invited webhook on success.
POST /organizations/{org_id}/members/invite
Path parameters
The UUID of the organization.
Body
The email address to send the invitation to.
curl -X POST \
https://api.docinject.io/api/v1/organizations/org-3f2a1b4c/members/invite \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"email": "newteammember@acme-corp.com"}'
Response 200
{
"email" : "newteammember@acme-corp.com" ,
"invited" : true
}
Inviting a member fires a member.invited webhook event with the payload { "email": "...", "invited_by": "<user_id>" }. Configure webhook endpoints in Settings → Webhooks.
Update member role
Change a member’s role within the organization. Requires admin role. Fires the member.role_changed webhook on success.
PATCH /organizations/{org_id}/members/{user_id}/role
Path parameters
The UUID of the organization.
The UUID of the member whose role you want to update.
Body
The new role to assign. Must be "admin" or "member".
curl -X PATCH \
https://api.docinject.io/api/v1/organizations/org-3f2a1b4c/members/usr-b2c3d4e5/role \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"role": "admin"}'
Response 204 No Content
You cannot demote the only admin in an organization. The API returns a 400 error if you attempt to do so.
Remove a member
Permanently remove a member from the organization and delete their auth account. Requires admin role.
DELETE /organizations/{org_id}/members/{user_id}
Path parameters
The UUID of the organization.
The UUID of the member to remove.
curl -X DELETE \
https://api.docinject.io/api/v1/organizations/org-3f2a1b4c/members/usr-b2c3d4e5 \
-H "Authorization: Bearer <token>"
Response 204 No Content
This action is irreversible. The member’s auth account is permanently deleted. Reassign any documents the member owns before removing them — use GET /organizations/{org_id}/members/{user_id}/owned-docs to check first.
List departments
Return all departments within an organization.
GET /organizations/{org_id}/departments
Path parameters
The UUID of the organization.
curl https://api.docinject.io/api/v1/organizations/org-3f2a1b4c/departments \
-H "Authorization: Bearer <token>"
Response 200
[
{ "id" : "dept-11aa22bb-33cc-44dd-55ee-66ff77889900" , "name" : "Engineering" },
{ "id" : "dept-aabb1122-ccdd-3344-eeff-556677889900" , "name" : "HR" }
]
Create a department
Add a new department to the organization. Requires admin role.
POST /organizations/{org_id}/departments
Path parameters
The UUID of the organization.
Body
The name of the new department.
curl -X POST \
https://api.docinject.io/api/v1/organizations/org-3f2a1b4c/departments \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"name": "Operations"}'
Response 201
{
"id" : "dept-ccdd3344-eeff-5566-7788-99aabb001122" ,
"name" : "Operations"
}
Delete a department
Remove a department from the organization. Requires admin role.
DELETE /organizations/{org_id}/departments/{dept_id}
Path parameters
The UUID of the organization.
The UUID of the department to delete.
curl -X DELETE \
https://api.docinject.io/api/v1/organizations/org-3f2a1b4c/departments/dept-ccdd3344 \
-H "Authorization: Bearer <token>"
Response 204 No Content
List API keys
Return all API keys belonging to the organization. The secret is never included in list responses.
GET /organizations/{org_id}/api-keys
Path parameters
The UUID of the organization.
curl https://api.docinject.io/api/v1/organizations/org-3f2a1b4c/api-keys \
-H "Authorization: Bearer <token>"
Response 200
Unique identifier for the API key.
Human-readable label for the key.
ISO 8601 timestamp of when the key was created.
[
{
"id" : "key-d1e2f3a4-b5c6-7890-dead-beef12345678" ,
"name" : "CI/CD pipeline" ,
"created_at" : "2024-03-01T08:00:00Z"
},
{
"id" : "key-e2f3a4b5-c6d7-8901-beef-dead23456789" ,
"name" : "Slack integration" ,
"created_at" : "2024-04-15T12:30:00Z"
}
]
Create an API key
Generate a new API key for the organization. The secret value is returned only in this response — store it securely immediately. Requires admin role.
POST /organizations/{org_id}/api-keys
Path parameters
The UUID of the organization.
Body
A label to identify this key (for example, "CI/CD pipeline").
curl -X POST \
https://api.docinject.io/api/v1/organizations/org-3f2a1b4c/api-keys \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"name": "CI/CD pipeline"}'
Response 201
Unique identifier for the new key.
The API key secret. This is the only time the secret is returned. Copy and store it now.
ISO 8601 timestamp of creation.
{
"id" : "key-d1e2f3a4-b5c6-7890-dead-beef12345678" ,
"name" : "CI/CD pipeline" ,
"secret" : "dik_live_4xR9mKpQ2nLwZvTsAoEcHgBfJuYdXi7N" ,
"created_at" : "2024-03-01T08:00:00Z"
}
The secret field is returned exactly once. If you lose it, revoke the key and create a new one.
Revoke an API key
Permanently delete an API key. Any requests using this key will immediately stop working. Requires admin role.
DELETE /organizations/{org_id}/api-keys/{key_id}
Path parameters
The UUID of the organization.
The UUID of the API key to revoke.
curl -X DELETE \
https://api.docinject.io/api/v1/organizations/org-3f2a1b4c/api-keys/key-d1e2f3a4 \
-H "Authorization: Bearer <token>"
Response 204 No Content