class

Polar::Api::Organizations

Inherits Reference < Object

API client for organizations operations

Constants

Log = ::Log.for(self)

Constructors

new(client : Client)

Creates a new Organizations instance

@param client [Client] The Polar API client instance

Source

Instance methods

Create Organization

Create an organization.

Scopes: organizations:write

Endpoint: POST /v1/organizations/

Parameters:

  • body (required): Request body as Polar::Models::OrganizationCreate

Returns: Polar::Models::Organization

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source

Get Organization

Get an organization by ID.

Scopes: organizations:read organizations:write

Endpoint: GET /v1/organizations/{id}

Parameters:

  • id (required): Path parameter

Returns: Polar::Models::Organization

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source
list(slug : String | Nil = nil, page : Int32 | Nil = nil, limit : Int32 | Nil = nil, sorting : String | Nil = nil) : Polar::Models::ListResource(Polar::Models::Organization)

List Organizations

List organizations.

Scopes: organizations:read organizations:write

Endpoint: GET /v1/organizations/

Parameters:

  • slug (optional): Filter by slug.
  • page (optional): Page number, defaults to 1.
  • limit (optional): Size of a page, defaults to 10. Maximum is 100.
  • sorting (optional): Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign - before the criteria name to sort by descending order.

Returns: Polar::Models::ListResource(Polar::Models::Organization)

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source

Update Organization

Update an organization.

Scopes: organizations:write

Endpoint: PATCH /v1/organizations/{id}

Parameters:

  • id (required): Path parameter
  • body (required): Request body as Polar::Models::OrganizationUpdate

Returns: Polar::Models::Organization

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source