Lewati ke konten utama

Organizations API

The organizations API lets you manage organization settings and retrieve organization data.

Procedures​

organization.get​

Get the current organization's details.

Type: Query

GET /trpc/organization.get

Response:

{
"result": {
"data": {
"id": "org_abc123",
"name": "Acme Corp",
"slug": "acme",
"logo": "https://cdn.probeya.com/logos/org_abc123.png",
"plan": "pro",
"createdAt": "2026-01-01T00:00:00Z",
"memberCount": 42,
"settings": {
"defaultLocale": "en",
"timezone": "America/New_York"
}
}
}
}

organization.update​

Update the current organization's settings.

Type: Mutation Required scope: admin

POST /trpc/organization.update

Input:

{
"name": "Acme Corporation",
"slug": "acme-corp",
"settings": {
"defaultLocale": "en",
"timezone": "America/New_York"
}
}

organization.listMembers​

List all members of the organization.

Type: Query Required scope: read:member

GET /trpc/organization.listMembers?input={"cursor":null,"limit":50}

Response:

{
"result": {
"data": {
"members": [
{
"id": "usr_abc123",
"name": "Jane Doe",
"email": "[email protected]",
"role": "admin",
"avatar": "https://cdn.probeya.com/avatars/usr_abc123.jpg",
"joinedAt": "2026-01-15T10:30:00Z",
"lastActiveAt": "2026-03-18T14:22:00Z"
}
],
"nextCursor": "usr_def456"
}
}
}

organization.inviteMember​

Invite a new member to the organization.

Type: Mutation Required scope: write:member

POST /trpc/organization.inviteMember

Input:

{
"email": "[email protected]",
"role": "member",
"workspaceIds": ["ws_abc123"]
}

organization.removeMember​

Remove a member from the organization.

Type: Mutation Required scope: write:member

POST /trpc/organization.removeMember

Input:

{
"userId": "usr_abc123"
}

organization.updateMemberRole​

Change a member's organization-level role.

Type: Mutation Required scope: admin

POST /trpc/organization.updateMemberRole

Input:

{
"userId": "usr_abc123",
"role": "admin"
}