Skip to content
Product Docs

Organizations

List Organizations
client.Organizations.List(ctx, query) (*PaginatedCursor[Organization], error)
GET/api/v2/organizations
Create Organization
client.Organizations.New(ctx, body) (*Organization, error)
POST/api/v2/organizations
Get Organization
client.Organizations.Get(ctx, organizationID) (*Organization, error)
GET/api/v2/organizations/{organization_id}
Update Organization
client.Organizations.Update(ctx, organizationID, body) (*Organization, error)
PUT/api/v2/organizations/{organization_id}
Delete Organization
client.Organizations.Delete(ctx, organizationID) error
DELETE/api/v2/organizations/{organization_id}
Get Organization Usage
client.Organizations.GetUsage(ctx, organizationID, query) (*UsageAndPlan, error)
GET/api/v1/organizations/{organization_id}/usage
ModelsExpand Collapse
type Organization struct{…}

API response schema for an organization.

ID string

The organization’s unique identifier.

Name string

The organization’s display name.

CreatedAt TimeOptional

Creation datetime

formatdate-time
Metadata map[string, any]Optional

Additional organization metadata.

UpdatedAt TimeOptional

Update datetime

formatdate-time
type OrganizationMember struct{…}

A user’s membership in an organization, including roles.

ID string

Unique identifier

formatuuid
OrganizationID string

The organization’s ID.

formatuuid

The roles of the user in the organization.

ID string

Unique identifier

formatuuid
OrganizationID string

The organization’s ID.

formatuuid
Role Role

The role.

ID string

Unique identifier

formatuuid
Name string

A name for the role.

maxLength3000
minLength1
Permissions []RolePermission

The actual permissions of the role.

ID string

Unique identifier

formatuuid
Access bool

Whether the permission is granted or not.

Description string

A description for the permission.

Name string

A name for the permission.

maxLength3000
minLength1
CreatedAt TimeOptional

Creation datetime

formatdate-time
UpdatedAt TimeOptional

Update datetime

formatdate-time
CreatedAt TimeOptional

Creation datetime

formatdate-time
UpdatedAt TimeOptional

Update datetime

formatdate-time
UserID string

The user’s ID.

CreatedAt TimeOptional

Creation datetime

formatdate-time
ProjectIDs []stringOptional

The project ID scope.

UpdatedAt TimeOptional

Update datetime

formatdate-time
CreatedAt TimeOptional

Creation datetime

formatdate-time
Email stringOptional

The user’s email address.

formatemail
DeprecatedInvitedByUserEmail stringOptional

The email address of the user who added the user to the organization.

formatemail
InvitedByUserID stringOptional

The user ID of the user who added the user to the organization.

Pending boolOptional

Whether the user’s membership is pending account signup.

UpdatedAt TimeOptional

Update datetime

formatdate-time
UserID stringOptional

The user’s ID.

type Role struct{…}

Schema for a role.

ID string

Unique identifier

formatuuid
Name string

A name for the role.

maxLength3000
minLength1
Permissions []RolePermission

The actual permissions of the role.

ID string

Unique identifier

formatuuid
Access bool

Whether the permission is granted or not.

Description string

A description for the permission.

Name string

A name for the permission.

maxLength3000
minLength1
CreatedAt TimeOptional

Creation datetime

formatdate-time
UpdatedAt TimeOptional

Update datetime

formatdate-time
CreatedAt TimeOptional

Creation datetime

formatdate-time
UpdatedAt TimeOptional

Update datetime

formatdate-time
type UsageAndPlan struct{…}
Plan UsageAndPlanPlan
Limits UsageAndPlanPlanLimits
AllowPayAsYouGo bool

Whether usage is allowed after credit grants are exhausted

MaxConcurrentIndexJobs int64
MaxConcurrentParseJobsOther int64
MaxConcurrentParseJobsPremium int64
MaxDataSinks int64
MaxDataSources int64
MaxEmbeddingModels int64
MaxExtractionAgents int64
MaxExtractionJobs int64
MaxExtractionRuns int64
MaxFilesPerIndex int64
MaxIndexes int64
MaxMonthlyInvoiceTotalUsd int64
MaxOrganizations int64
MaxPagesPerIndex int64
MaxProjects int64
MaxPublishedAgents int64
MaxReportAgentSessions int64
MaxUsers int64
MfaEnabled bool
SSOEnabled bool
SubscriptionCostUsd int64
MaxDirectories int64Optional
MaxDirectoryFilesPerDirectory int64Optional
MaxDirectoryIngestFiles int64Optional
MaxDirectorySyncPlanActions int64Optional
SpendingSoftAlertsUsdCents []int64Optional

The amount of USD cents at which a soft alert should be triggered

Name string
One of the following:
const UsageAndPlanPlanNameEnterprise UsageAndPlanPlanName = "enterprise"
const UsageAndPlanPlanNameEnterpriseContract UsageAndPlanPlanName = "enterprise_contract"
const UsageAndPlanPlanNameEnterprisePoc UsageAndPlanPlanName = "enterprise_poc"
const UsageAndPlanPlanNameFree UsageAndPlanPlanName = "free"
const UsageAndPlanPlanNameFreeContract UsageAndPlanPlanName = "free_contract"
const UsageAndPlanPlanNameFreeV1 UsageAndPlanPlanName = "free_v1"
const UsageAndPlanPlanNameFreeV2 UsageAndPlanPlanName = "free_v2"
const UsageAndPlanPlanNameLlamaParse UsageAndPlanPlanName = "llama_parse"
const UsageAndPlanPlanNamePro UsageAndPlanPlanName = "pro"
const UsageAndPlanPlanNameProV1 UsageAndPlanPlanName = "pro_v1"
const UsageAndPlanPlanNameProV2 UsageAndPlanPlanName = "pro_v2"
const UsageAndPlanPlanNameStarterV1 UsageAndPlanPlanName = "starter_v1"
const UsageAndPlanPlanNameStarterV2 UsageAndPlanPlanName = "starter_v2"
const UsageAndPlanPlanNameUnknown UsageAndPlanPlanName = "unknown"
const UsageAndPlanPlanNameYcDealV1 UsageAndPlanPlanName = "yc_deal_v1"
PlanFrequency string
One of the following:
const UsageAndPlanPlanPlanFrequencyAnnual UsageAndPlanPlanPlanFrequency = "ANNUAL"
const UsageAndPlanPlanPlanFrequencyMonthly UsageAndPlanPlanPlanFrequency = "MONTHLY"
const UsageAndPlanPlanPlanFrequencyQuarterly UsageAndPlanPlanPlanFrequency = "QUARTERLY"
ID stringOptional

The ID of the plan in Metronome

CurrentBillingPeriod UsageAndPlanPlanCurrentBillingPeriodOptional

The current billing period

EndDate Time
StartDate Time
EndingBefore TimeOptional

The date the plan ends on

formatdate-time
FailureCount int64Optional

The number of payment failures for this organization

IsPaymentFailed boolOptional

Whether the organization has a failed payment that requires support contact

RecurringCredits []UsageAndPlanPlanRecurringCreditOptional
CreditAmount int64
CreditType UsageAndPlanPlanRecurringCreditCreditType
ID string
Name string
Name string
Priority float64
ProductID string

The ID of the product in Metronome used to represent the credit grant

RolloverFraction float64

The fraction of the credit that will roll over to the next period, between 0 and 1

PeriodsDuration float64Optional

How many billing periods the credit grant will last for

StartingOn TimeOptional

The date the plan starts on

formatdate-time
Usage UsageAndPlanUsage

Account usage totals shown alongside the plan.

ActiveAlerts []stringOptional
One of the following:
const UsageAndPlanUsageActiveAlertConfiguredSpendLimitExceeded UsageAndPlanUsageActiveAlert = "configured_spend_limit_exceeded"
const UsageAndPlanUsageActiveAlertFreeCreditsExhausted UsageAndPlanUsageActiveAlert = "free_credits_exhausted"
const UsageAndPlanUsageActiveAlertHasSpendingAlert UsageAndPlanUsageActiveAlert = "has_spending_alert"
const UsageAndPlanUsageActiveAlertInternalSpendingAlert UsageAndPlanUsageActiveAlert = "internal_spending_alert"
const UsageAndPlanUsageActiveAlertPlanSpendLimitExceeded UsageAndPlanUsageActiveAlert = "plan_spend_limit_exceeded"
const UsageAndPlanUsageActiveAlertPlanSpendLimitSoftAlert UsageAndPlanUsageActiveAlert = "plan_spend_limit_soft_alert"
ActiveFreeCreditsUsage []UsageAndPlanUsageActiveFreeCreditsUsageOptional
ExpiresAt Time
GrantName string
RemainingBalance int64
StartingBalance int64
CurrentInvoiceTotalUsdCents int64Optional
TotalExtractionAgents int64Optional
TotalIndexedPages int64Optional
TotalIndexes int64Optional
TotalUsers int64Optional
type UserOrganizationRole struct{…}

Schema for a user’s role in an organization.

ID string

Unique identifier

formatuuid
OrganizationID string

The organization’s ID.

formatuuid
Role Role

The role.

ID string

Unique identifier

formatuuid
Name string

A name for the role.

maxLength3000
minLength1
Permissions []RolePermission

The actual permissions of the role.

ID string

Unique identifier

formatuuid
Access bool

Whether the permission is granted or not.

Description string

A description for the permission.

Name string

A name for the permission.

maxLength3000
minLength1
CreatedAt TimeOptional

Creation datetime

formatdate-time
UpdatedAt TimeOptional

Update datetime

formatdate-time
CreatedAt TimeOptional

Creation datetime

formatdate-time
UpdatedAt TimeOptional

Update datetime

formatdate-time
UserID string

The user’s ID.

CreatedAt TimeOptional

Creation datetime

formatdate-time
ProjectIDs []stringOptional

The project ID scope.

UpdatedAt TimeOptional

Update datetime

formatdate-time

OrganizationsUsers

List Organization Users
client.Organizations.Users.ListMembers(ctx, organizationID) (*[]OrganizationMember, error)
GET/api/v1/organizations/{organization_id}/users
Add Users To Organization
client.Organizations.Users.Add(ctx, organizationID, body) (*[]OrganizationMember, error)
PUT/api/v1/organizations/{organization_id}/users
Remove Users From Organization
client.Organizations.Users.Delete(ctx, memberUserID, params) error
DELETE/api/v1/organizations/{organization_id}/users/{member_user_id}
Assign Role To User In Organization
client.Organizations.Users.AssignRole(ctx, organizationID, body) (*UserOrganizationRole, error)
PUT/api/v1/organizations/{organization_id}/users/roles
List Projects By User
client.Organizations.Users.ListProjects(ctx, userID, query) (*[]OrganizationUserListProjectsResponse, error)
GET/api/v1/organizations/{organization_id}/users/{user_id}/projects
Add User To Project
client.Organizations.Users.AddToProject(ctx, userID, params) (*OrganizationUserAddToProjectResponse, error)
PUT/api/v1/organizations/{organization_id}/users/{user_id}/projects
Remove User From Project
client.Organizations.Users.RemoveFromProject(ctx, projectID, body) (*OrganizationUserRemoveFromProjectResponse, error)
DELETE/api/v1/organizations/{organization_id}/users/{user_id}/projects/{project_id}

OrganizationsRoles

List Roles
client.Organizations.Roles.List(ctx, organizationID) (*[]Role, error)
GET/api/v1/organizations/{organization_id}/roles