Liking cljdoc? Tell your friends :D

anthropic.organization

Clojure wrappers over the beta Organization administration APIs of the official Anthropic Java SDK: the organization itself plus users, API keys, external keys, invites, rate limits, service accounts, workspaces, workspace members/rate-limits/service-accounts, and identity federation (issuers, rules, and rule workspaces).

These wrap beta endpoints that Anthropic may change. Build a request as a Clojure map, get a Clojure map back. Errors follow anthropic.core's contract: API/IO failures are ex-info keyed :anthropic/error with the SDK exception as cause.

Deeply nested response sub-objects (an API key's principal/scope, an external key's provider config/attachment, a federation issuer's JWKS, a rule's match/target/attributes) are returned as full-fidelity Clojure data. For the matching request inputs, scalar fields are accepted as idiomatic maps; the richest union inputs (inline JWKS keys, Azure external-key configs, match claims) also accept a ready SDK object as an escape hatch.

Clojure wrappers over the beta Organization administration APIs of the
official Anthropic Java SDK: the organization itself plus users, API keys,
external keys, invites, rate limits, service accounts, workspaces, workspace
members/rate-limits/service-accounts, and identity federation (issuers, rules,
and rule workspaces).

These wrap beta endpoints that Anthropic may change. Build a request as a
Clojure map, get a Clojure map back. Errors follow `anthropic.core`'s
contract: API/IO failures are ex-info keyed `:anthropic/error` with the SDK
exception as cause.

Deeply nested response sub-objects (an API key's principal/scope, an external
key's provider config/attachment, a federation issuer's JWKS, a rule's
match/target/attributes) are returned as full-fidelity Clojure data. For the
matching request inputs, scalar fields are accepted as idiomatic maps; the
richest union inputs (inline JWKS keys, Azure external-key configs, match
claims) also accept a ready SDK object as an escape hatch.
raw docstring

add-federation-rule-workspaceclj

(add-federation-rule-workspace client rule-id workspace-id)

Attach a workspace to a federation rule.

Attach a workspace to a federation rule.
sourceraw docstring

add-service-account-workspaceclj

(add-service-account-workspace client
                               service-account-id
                               {:keys [workspace-id workspace-role]})

Add a service account to a workspace with :workspace-role (a non-billing workspace role).

Add a service account to a workspace with `:workspace-role` (a non-billing
workspace role).
sourceraw docstring

add-workspace-memberclj

(add-workspace-member client workspace-id {:keys [user-id workspace-role]})

Add a user to a workspace with :workspace-role (a non-billing workspace role).

Add a user to a workspace with `:workspace-role` (a non-billing workspace
role).
sourceraw docstring

add-workspace-service-accountclj

(add-workspace-service-account client
                               workspace-id
                               {:keys [service-account-id workspace-role]})

Add a service account to a workspace with :workspace-role (non-billing).

Add a service account to a workspace with `:workspace-role` (non-billing).
sourceraw docstring

archive-federation-issuerclj

(archive-federation-issuer client issuer-id)

Archive a federation issuer by id. Returns the archived issuer.

Archive a federation issuer by id. Returns the archived issuer.
sourceraw docstring

archive-federation-ruleclj

(archive-federation-rule client rule-id)

Archive a federation rule by id. Returns the archived rule.

Archive a federation rule by id. Returns the archived rule.
sourceraw docstring

archive-service-accountclj

(archive-service-account client service-account-id)

Archive a service account by id. Returns the archived service account.

Archive a service account by id. Returns the archived service account.
sourceraw docstring

archive-workspaceclj

(archive-workspace client workspace-id)

Archive a workspace by id. Returns the archived workspace.

Archive a workspace by id. Returns the archived workspace.
sourceraw docstring

create-external-keyclj

(create-external-key client
                     {:keys [display-name geo aws-provider-config
                             gcp-provider-config provider-config]})

Create an external key. Provide a provider config as one of :aws-provider-config/:gcp-provider-config (a key name string) or :provider-config (a ready SDK config object). Options: :display-name, :geo (:us).

Create an external key. Provide a provider config as one of
`:aws-provider-config`/`:gcp-provider-config` (a key name string) or
`:provider-config` (a ready SDK config object). Options: `:display-name`,
`:geo` (`:us`).
sourceraw docstring

create-federation-issuerclj

(create-federation-issuer client
                          {:keys [name issuer-url explicit-url-jwks jwks
                                  check-jti max-jwt-lifetime-seconds]})

Create a federation issuer. Requires :name and :issuer-url. JWKS via :explicit-url-jwks (a URL string) or :jwks (a ready SDK JWKS object). Optional :check-jti, :max-jwt-lifetime-seconds.

Create a federation issuer. Requires `:name` and `:issuer-url`. JWKS via
`:explicit-url-jwks` (a URL string) or `:jwks` (a ready SDK JWKS object).
Optional `:check-jti`, `:max-jwt-lifetime-seconds`.
sourceraw docstring

create-federation-ruleclj

(create-federation-rule client
                        {:keys [name issuer-id oauth-scope
                                token-lifetime-seconds target description
                                applies-to-all-workspaces workspace-id match]})

Create a federation rule. Requires :name, :issuer-id, :oauth-scope, :token-lifetime-seconds, and :target (a map {:service-account-id ...} or a ready SDK target). Optional :description, :applies-to-all-workspaces, :workspace-id, and :match (a map of :audience/:condition/ :subject-prefix/:claims, or a ready SDK match).

Create a federation rule. Requires `:name`, `:issuer-id`, `:oauth-scope`,
`:token-lifetime-seconds`, and `:target` (a map `{:service-account-id ...}`
or a ready SDK target). Optional `:description`, `:applies-to-all-workspaces`,
`:workspace-id`, and `:match` (a map of `:audience`/`:condition`/
`:subject-prefix`/`:claims`, or a ready SDK match).
sourceraw docstring

create-inviteclj

(create-invite client {:keys [email role rbac-group-ids]})

Create an organization invite. Requires :email and :role (one of the invite roles). Optional :rbac-group-ids (a seq of strings).

Create an organization invite. Requires `:email` and `:role` (one of the
invite roles). Optional `:rbac-group-ids` (a seq of strings).
sourceraw docstring

create-service-accountclj

(create-service-account client {:keys [name description organization-role]})

Create a service account. Requires :name. Optional :description, :organization-role (:admin/:developer).

Create a service account. Requires `:name`. Optional `:description`,
`:organization-role` (`:admin`/`:developer`).
sourceraw docstring

create-workspaceclj

(create-workspace client
                  {:keys [name display-color external-key-id data-residency
                          tags]})

Create a workspace. Requires :name. Optional :display-color, :external-key-id, and :data-residency/:tags as ready SDK config objects.

Create a workspace. Requires `:name`. Optional `:display-color`,
`:external-key-id`, and `:data-residency`/`:tags` as ready SDK config objects.
sourceraw docstring

delete-external-keyclj

(delete-external-key client external-key-id)

Delete an external key by id. Returns the delete response as a map.

Delete an external key by id. Returns the delete response as a map.
sourceraw docstring

delete-inviteclj

(delete-invite client invite-id)

Delete an invite by id. Returns the delete response as a map.

Delete an invite by id. Returns the delete response as a map.
sourceraw docstring

get-api-keyclj

(get-api-key client api-key-id)

Retrieve one organization API key by id.

Retrieve one organization API key by id.
sourceraw docstring

get-external-keyclj

(get-external-key client external-key-id)

Retrieve one external key by id.

Retrieve one external key by id.
sourceraw docstring

get-federation-issuerclj

(get-federation-issuer client issuer-id)

Retrieve one federation issuer by id.

Retrieve one federation issuer by id.
sourceraw docstring

get-federation-ruleclj

(get-federation-rule client rule-id)

Retrieve one federation rule by id.

Retrieve one federation rule by id.
sourceraw docstring

get-inviteclj

(get-invite client invite-id)

Retrieve one invite by id.

Retrieve one invite by id.
sourceraw docstring

get-org-userclj

(get-org-user client user-id)

Retrieve one organization user by id.

Retrieve one organization user by id.
sourceraw docstring

get-organizationclj

(get-organization client)

Retrieve the caller's organization, as {:id ... :name ...}.

Retrieve the caller's organization, as `{:id ... :name ...}`.
sourceraw docstring

get-service-accountclj

(get-service-account client service-account-id)

Retrieve one service account by id.

Retrieve one service account by id.
sourceraw docstring

get-workspaceclj

(get-workspace client workspace-id)

Retrieve one workspace by id.

Retrieve one workspace by id.
sourceraw docstring

get-workspace-memberclj

(get-workspace-member client workspace-id user-id)

Retrieve one workspace member by workspace id and user id.

Retrieve one workspace member by workspace id and user id.
sourceraw docstring

get-workspace-service-accountclj

(get-workspace-service-account client workspace-id service-account-id)

Retrieve a service account's membership in a workspace.

Retrieve a service account's membership in a workspace.
sourceraw docstring

list-api-keysclj

(list-api-keys client)
(list-api-keys client
               {:keys [limit after-id before-id status workspace-id
                       created-by-user-id]})

List organization API keys. Options: :limit, :after-id, :before-id, :status (:active/:archived/:expired/:inactive), :workspace-id, :created-by-user-id.

List organization API keys. Options: `:limit`, `:after-id`, `:before-id`,
`:status` (`:active`/`:archived`/`:expired`/`:inactive`), `:workspace-id`,
`:created-by-user-id`.
sourceraw docstring

list-external-keysclj

(list-external-keys client)
(list-external-keys client {:keys [limit page]})

List external keys. Options: :limit, :page.

List external keys. Options: `:limit`, `:page`.
sourceraw docstring

list-federation-issuersclj

(list-federation-issuers client)
(list-federation-issuers client {:keys [limit page include-archived]})

List federation issuers. Options: :limit, :page, :include-archived.

List federation issuers. Options: `:limit`, `:page`, `:include-archived`.
sourceraw docstring

list-federation-rule-workspacesclj

(list-federation-rule-workspaces client rule-id)
(list-federation-rule-workspaces client rule-id {:keys [limit page]})

List the workspaces attached to a federation rule. Options: :limit, :page.

List the workspaces attached to a federation rule. Options: `:limit`, `:page`.
sourceraw docstring

list-federation-rulesclj

(list-federation-rules client)
(list-federation-rules client {:keys [limit page include-archived issuer-id]})

List federation rules. Options: :limit, :page, :include-archived, :issuer-id.

List federation rules. Options: `:limit`, `:page`, `:include-archived`,
`:issuer-id`.
sourceraw docstring

list-invitesclj

(list-invites client)
(list-invites client {:keys [limit after-id before-id email roles statuses]})

List invites. Options: :limit, :after-id, :before-id, :email, :roles (seq of role strings), :statuses (seq of :accepted/:expired/ :pending).

List invites. Options: `:limit`, `:after-id`, `:before-id`, `:email`,
`:roles` (seq of role strings), `:statuses` (seq of `:accepted`/`:expired`/
`:pending`).
sourceraw docstring

list-org-usersclj

(list-org-users client)
(list-org-users client {:keys [limit after-id before-id email roles]})

List organization users. Options: :limit, :after-id, :before-id, :email, :roles (a seq of role strings).

List organization users. Options: `:limit`, `:after-id`, `:before-id`,
`:email`, `:roles` (a seq of role strings).
sourceraw docstring

list-rate-limitsclj

(list-rate-limits client)
(list-rate-limits client {:keys [limit page model group-type]})

List organization rate limits. Options: :limit, :page, :model, :group-type (:batch/:files/:model-group/:skills/:token-count/ :web-search).

List organization rate limits. Options: `:limit`, `:page`, `:model`,
`:group-type` (`:batch`/`:files`/`:model-group`/`:skills`/`:token-count`/
`:web-search`).
sourceraw docstring

list-service-account-workspacesclj

(list-service-account-workspaces client service-account-id)
(list-service-account-workspaces client service-account-id {:keys [limit page]})

List the workspaces a service account belongs to. Options: :limit, :page.

List the workspaces a service account belongs to. Options: `:limit`, `:page`.
sourceraw docstring

list-service-accountsclj

(list-service-accounts client)
(list-service-accounts client {:keys [limit page include-archived]})

List service accounts. Options: :limit, :page, :include-archived.

List service accounts. Options: `:limit`, `:page`, `:include-archived`.
sourceraw docstring

list-workspace-membersclj

(list-workspace-members client workspace-id)
(list-workspace-members client workspace-id {:keys [limit after-id before-id]})

List a workspace's members. Options: :limit, :after-id, :before-id.

List a workspace's members. Options: `:limit`, `:after-id`, `:before-id`.
sourceraw docstring

list-workspace-rate-limitsclj

(list-workspace-rate-limits client workspace-id)
(list-workspace-rate-limits client workspace-id {:keys [limit page group-type]})

List a workspace's rate limits. Options: :limit, :page, :group-type.

List a workspace's rate limits. Options: `:limit`, `:page`, `:group-type`.
sourceraw docstring

list-workspace-service-accountsclj

(list-workspace-service-accounts client workspace-id)
(list-workspace-service-accounts client workspace-id {:keys [limit page]})

List a workspace's service accounts. Options: :limit, :page.

List a workspace's service accounts. Options: `:limit`, `:page`.
sourceraw docstring

list-workspacesclj

(list-workspaces client)
(list-workspaces client {:keys [limit after-id before-id include-archived]})

List workspaces. Options: :limit, :after-id, :before-id, :include-archived.

List workspaces. Options: `:limit`, `:after-id`, `:before-id`,
`:include-archived`.
sourceraw docstring

remove-federation-rule-workspaceclj

(remove-federation-rule-workspace client rule-id workspace-id)

Detach a workspace from a federation rule. Returns the removal response map.

Detach a workspace from a federation rule. Returns the removal response map.
sourceraw docstring

remove-org-userclj

(remove-org-user client user-id)

Remove a user from the organization. Returns the removal response as a map.

Remove a user from the organization. Returns the removal response as a map.
sourceraw docstring

remove-service-account-workspaceclj

(remove-service-account-workspace client service-account-id workspace-id)

Remove a service account from a workspace. Returns the removal response map.

Remove a service account from a workspace. Returns the removal response map.
sourceraw docstring

remove-workspace-memberclj

(remove-workspace-member client workspace-id user-id)

Remove a user from a workspace. Returns the removal response as a map.

Remove a user from a workspace. Returns the removal response as a map.
sourceraw docstring

remove-workspace-service-accountclj

(remove-workspace-service-account client workspace-id service-account-id)

Remove a service account from a workspace. Returns the removal response map.

Remove a service account from a workspace. Returns the removal response map.
sourceraw docstring

update-api-keyclj

(update-api-key client api-key-id {:keys [name status]})

Update an API key's :name and/or :status (:active, :archived, :inactive).

Update an API key's `:name` and/or `:status` (`:active`, `:archived`,
`:inactive`).
sourceraw docstring

update-external-keyclj

(update-external-key client
                     external-key-id
                     {:keys [display-name geo aws-provider-config
                             gcp-provider-config provider-config]})

Update an external key's :display-name, provider config (:aws-provider-config/:gcp-provider-config/:provider-config), or :geo.

Update an external key's `:display-name`, provider config
(`:aws-provider-config`/`:gcp-provider-config`/`:provider-config`), or `:geo`.
sourceraw docstring

update-federation-issuerclj

(update-federation-issuer client
                          issuer-id
                          {:keys [name issuer-url explicit-url-jwks jwks
                                  check-jti max-jwt-lifetime-seconds
                                  jwks-polling-disabled]})

Update a federation issuer's :name, :issuer-url, JWKS (:explicit-url-jwks/:jwks), :check-jti, :max-jwt-lifetime-seconds, or :jwks-polling-disabled.

Update a federation issuer's `:name`, `:issuer-url`, JWKS
(`:explicit-url-jwks`/`:jwks`), `:check-jti`, `:max-jwt-lifetime-seconds`, or
`:jwks-polling-disabled`.
sourceraw docstring

update-federation-ruleclj

(update-federation-rule client
                        rule-id
                        {:keys [name description oauth-scope
                                token-lifetime-seconds applies-to-all-workspaces
                                workspace-id target match]})

Update a federation rule's :name, :description, :oauth-scope, :token-lifetime-seconds, :applies-to-all-workspaces, :workspace-id, :target, or :match.

Update a federation rule's `:name`, `:description`, `:oauth-scope`,
`:token-lifetime-seconds`, `:applies-to-all-workspaces`, `:workspace-id`,
`:target`, or `:match`.
sourceraw docstring

update-org-userclj

(update-org-user client user-id {:keys [role]})

Update an organization user's :role (one of the organization roles).

Update an organization user's `:role` (one of the organization roles).
sourceraw docstring

update-service-accountclj

(update-service-account client
                        service-account-id
                        {:keys [description organization-role]})

Update a service account's :description and/or :organization-role.

Update a service account's `:description` and/or `:organization-role`.
sourceraw docstring

update-workspaceclj

(update-workspace client
                  workspace-id
                  {:keys [name display-color external-key-id data-residency
                          tags]})

Update a workspace's :name, :display-color, :external-key-id, or :data-residency/:tags (ready SDK config objects).

Update a workspace's `:name`, `:display-color`, `:external-key-id`, or
`:data-residency`/`:tags` (ready SDK config objects).
sourceraw docstring

update-workspace-memberclj

(update-workspace-member client workspace-id user-id {:keys [workspace-role]})

Update a workspace member's :workspace-role (any workspace role).

Update a workspace member's `:workspace-role` (any workspace role).
sourceraw docstring

update-workspace-service-accountclj

(update-workspace-service-account client
                                  workspace-id
                                  service-account-id
                                  {:keys [workspace-role]})

Update a workspace service account's :workspace-role (a non-billing role).

Update a workspace service account's `:workspace-role` (a non-billing role).
sourceraw docstring

validate-external-keyclj

(validate-external-key client external-key-id)

Validate an external key by id. Returns the validation response as a map.

Validate an external key by id. Returns the validation response as a map.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close