Organizations: list with cursor pagination, read, create, update, delete, upsert, and exact-match search by name or external id.

Context Vars

Optional
  • zendesk.subdomain

Functions

create-or-update-organization

fn (fields: Map): Any
fn (fields: Map, opts: Map): Any

POST /organizations/create_or_update - Upsert an organization matched on id or external_id.

Example

out ::zendesk::organizations/create-or-update-organization({external_id: "acme-42", name: "Acme Inc"})
out.organization.id

create-organization

fn (fields: Map): Any
fn (fields: Map, opts: Map): Any

POST /organizations - Create an organization. fields: name (required, unique), external_id, domain_names (Vec), details, notes, group_id, shared_tickets, tags, organization_fields. Unset fields are omitted.

Example

out ::zendesk::organizations/create-organization({name: "Acme", external_id: "acme-42", domain_names: ["acme.example"]})
out.organization.id

delete-organization

fn (id: Any): Any
fn (id: Any, opts: Map): Any

DELETE /organizations/{id} - Delete an organization. Returns null.

Example

::zendesk::organizations/delete-organization(360001)

get-organization

fn (id: Any): Any
fn (id: Any, opts: Map): Any

GET /organizations/{id} - One organization: {organization}.

Example

out ::zendesk::organizations/get-organization(360001)
out.organization.name

list-organizations

fn (): Any
fn (options: Map): Any
fn (options: Map, opts: Map): Any

GET /organizations - One cursor page: {organizations, meta, links}. options: page_size, after, sort.

Example

page ::zendesk::organizations/list-organizations({page_size: 50, sort: "-created_at"})
map(page.organizations, %.name)

search-organizations

fn (by: Map): Any
fn (by: Map, opts: Map): Any

GET /organizations/search - Exact-match (case-insensitive) lookup: pass {name: "Acme"} or {external_id: "acme-42"}, not both. Returns {organizations, count}. For fuzzy matches use ::zendesk::search/search("type:organization acme").

Example

out ::zendesk::organizations/search-organizations({external_id: "acme-42"})
map(out.organizations, %.name)

update-organization

fn (id: Any, fields: Map): Any
fn (id: Any, fields: Map, opts: Map): Any

PUT /organizations/{id} - Update an organization's fields. Unset fields are omitted.

Example

out ::zendesk::organizations/update-organization(360001, {notes: "Renewal in March"})
out.organization.notes