Organizations
Read and update your organization, manage its members and their roles, and send, list or revoke invites.
On this page
Every call acts on the key’s own organization (permissions).
me
The key’s organization.
Source: Organizations.me
org = client.organizations.me()
print(org.name, org.subscription_tier, org.member_count, org.max_users)
pictograph organizations me
curl -s "https://api.pictograph.io/api/v1/developer/organizations/me" \
-H "X-API-Key: $PICTOGRAPH_API_KEY"
Returns Organization
Organization · 16 fields
class Organization(BaseModel):
"""An organization: its plan, its plan's limits, and its member and invite counts."""
id: str
name: str
slug: str
description: str | None = None
is_public: bool | None = None
# Its plan.
subscription_tier: Union[Literal['free', 'core', 'pro', 'team', 'enterprise'], str]
# DEPRECATED: whole dollars left this period. Use credits.balance().
credits_remaining: int
# DEPRECATED: the monthly allowance in whole dollars. Use credits.balance().
credits_monthly_allowance: int
credits_reset_at: datetime | None = None
# Members its plan allows, pending invites included.
max_users: int
# Images its plan allows.
max_images: int
# Storage its plan allows, in bytes.
max_storage_bytes: int
member_count: int
pending_invite_count: int
created_at: datetime
updated_at: datetime
update
Change the organization’s profile; only the fields you pass change.
Source: Organizations.update
| Arg | Type | Default | Notes |
|---|---|---|---|
name |
str | None |
None |
New organization name |
description |
str | None |
None |
New description |
is_public |
bool | None |
None |
Whether the organization has a public profile page |
org = client.organizations.update(
name="Acme Vision",
description="Perception datasets for autonomous inspection.",
is_public=True,
)
pictograph organizations update \
--name "Acme Vision" \
--description "Perception datasets for autonomous inspection." \
--public
curl -s -X PATCH "https://api.pictograph.io/api/v1/developer/organizations/me" \
-H "X-API-Key: $PICTOGRAPH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Acme Vision",
"description": "Perception datasets for autonomous inspection.",
"is_public": true}'
Returns Organization
Organization · 16 fields
class Organization(BaseModel):
"""An organization: its plan, its plan's limits, and its member and invite counts."""
id: str
name: str
slug: str
description: str | None = None
is_public: bool | None = None
# Its plan.
subscription_tier: Union[Literal['free', 'core', 'pro', 'team', 'enterprise'], str]
# DEPRECATED: whole dollars left this period. Use credits.balance().
credits_remaining: int
# DEPRECATED: the monthly allowance in whole dollars. Use credits.balance().
credits_monthly_allowance: int
credits_reset_at: datetime | None = None
# Members its plan allows, pending invites included.
max_users: int
# Images its plan allows.
max_images: int
# Storage its plan allows, in bytes.
max_storage_bytes: int
member_count: int
pending_invite_count: int
created_at: datetime
updated_at: datetime
list_members
Every member, with the membership id the role and removal calls take.
Source: Organizations.list_members
for m in client.organizations.list_members():
print(m.id, m.email, m.role, m.joined_at)
pictograph organizations members
curl -s "https://api.pictograph.io/api/v1/developer/organizations/members" \
-H "X-API-Key: $PICTOGRAPH_API_KEY"
Returns list[OrganizationMember]
OrganizationMember · 6 fields
class OrganizationMember(BaseModel):
"""One member of the organization."""
# Membership id: update_member_role and remove_member take it.
id: str
user_id: str
email: str | None = None
full_name: str | None = None
role: Literal['owner', 'admin', 'member', 'annotator', 'viewer']
joined_at: datetime
update_member_role
Change a member’s role. The last owner can’t be demoted.
Source: Organizations.update_member_role
| Arg | Type | Default | Notes |
|---|---|---|---|
member |
str |
required | Member’s email, or membership id from list_members (not the user id) |
role |
OrganizationRole |
required | New role: owner, admin, member, annotator or viewer |
client.organizations.update_member_role(
member="e1f2a3b4-5c6d-4e78-9f01-a2b3c4d5e6f7",
role="admin",
)
pictograph organizations member-role e1f2a3b4-5c6d-4e78-9f01-a2b3c4d5e6f7 --role admin
curl -s -X PATCH "https://api.pictograph.io/api/v1/developer/organizations/members/e1f2a3b4-5c6d-4e78-9f01-a2b3c4d5e6f7" \
-H "X-API-Key: $PICTOGRAPH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"role": "admin"}'
Returns dict[str, Any]
It returns {id, role}; list_members has the full record.
remove_member
Remove a member. Their account stays, and they can be invited again. The last owner can’t be removed.
Source: Organizations.remove_member
| Arg | Type | Default | Notes |
|---|---|---|---|
member |
str |
required | Member’s email or membership id |
client.organizations.remove_member(member="e1f2a3b4-5c6d-4e78-9f01-a2b3c4d5e6f7")
pictograph organizations member-remove e1f2a3b4-5c6d-4e78-9f01-a2b3c4d5e6f7 --yes
curl -s -X DELETE "https://api.pictograph.io/api/v1/developer/organizations/members/e1f2a3b4-5c6d-4e78-9f01-a2b3c4d5e6f7" \
-H "X-API-Key: $PICTOGRAPH_API_KEY"
Returns None
list_invites
Your organization’s invites.
Source: Organizations.list_invites
| Arg | Type | Default | Notes |
|---|---|---|---|
status |
InviteStatus | None |
None |
Only invites in this state: pending, accepted, declined, expired or revoked |
for inv in client.organizations.list_invites(status="pending"):
print(inv.id, inv.email, inv.role, inv.expires_at)
pictograph organizations invites --status pending
curl -s "https://api.pictograph.io/api/v1/developer/organizations/invites?status=pending" \
-H "X-API-Key: $PICTOGRAPH_API_KEY"
Returns list[OrganizationInvite]
OrganizationInvite · 8 fields
class OrganizationInvite(BaseModel):
"""A pending / accepted / expired / revoked / declined invite."""
id: str
organization_id: str
email: str
role: Literal['admin', 'member', 'annotator', 'viewer']
status: Literal['pending', 'accepted', 'expired', 'revoked', 'declined']
invited_by: str | None = None
expires_at: datetime
created_at: datetime
invite
Invite someone by email; Pictograph sends the email. Owners can’t be invited: promote a member after they join.
Source: Organizations.invite
| Arg | Type | Default | Notes |
|---|---|---|---|
email |
str |
required | Email address to invite |
role |
InviteRole |
"member" |
admin, member, annotator or viewer |
invite = client.organizations.invite(
email="new@example.com",
role="member",
)
print(invite.email, invite.status)
pictograph organizations invite new@example.com --role member
curl -s -X POST "https://api.pictograph.io/api/v1/developer/organizations/invites" \
-H "X-API-Key: $PICTOGRAPH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "new@example.com", "role": "member"}'
Returns OrganizationInvite
OrganizationInvite · 8 fields
class OrganizationInvite(BaseModel):
"""A pending / accepted / expired / revoked / declined invite."""
id: str
organization_id: str
email: str
role: Literal['admin', 'member', 'annotator', 'viewer']
status: Literal['pending', 'accepted', 'expired', 'revoked', 'declined']
invited_by: str | None = None
expires_at: datetime
created_at: datetime
revoke_invite
Cancel a pending invite.
Source: Organizations.revoke_invite
| Arg | Type | Default | Notes |
|---|---|---|---|
invite |
str |
required | Invite id or email |
client.organizations.revoke_invite(invite="f2a3b4c5-6d7e-4f89-a012-b3c4d5e6f7a8")
pictograph organizations invite-revoke f2a3b4c5-6d7e-4f89-a012-b3c4d5e6f7a8 --yes
curl -s -X DELETE "https://api.pictograph.io/api/v1/developer/organizations/invites/f2a3b4c5-6d7e-4f89-a012-b3c4d5e6f7a8" \
-H "X-API-Key: $PICTOGRAPH_API_KEY"
Returns None
Permissions
| Operation | Minimum role |
|---|---|
me, list_members, list_invites |
viewer |
update, update_member_role, invite, revoke_invite |
admin |
remove_member |
admin, and never the last owner |
Common errors
| Status | Exception | Cause |
|---|---|---|
| 402 | PaymentRequiredError |
Your plan’s member limit (members plus pending invites) is reached |
| 403 | ForbiddenError |
A key below admin (any change) |
| 404 | NotFoundError |
The member or invite doesn’t exist in this organization |
| 409 | ConflictError |
The email already belongs to a member or has a pending invite |
| 422 | ValidationError |
An invalid role or email, or demoting or removing the last owner |