Organizations

Update the current organization

Updates the current organization's profile, avatar, regional defaults, and reply-to default and returns the saved organization.

PATCH
/v1/organizations/current

Updates the current organization's profile, avatar, regional defaults, and reply-to default and returns the saved organization. avatarUrl accepts only the src returned by an avatar upload, and null removes the avatar. metadata is merged into the stored value; every other field is replaced.

Authorization

apiKey
headerx-api-key<token>

Request Body

application/json
  1. body
name?|null
slug?string|null
avatarUrl?||null
defaultRegion?|null|null
timezone?IanaTimezone|null
isActive?boolean|null
metadata?|null
replyToDefault?array<string>|null|null
emailFooterEnabledDefault?boolean|null|null

Response Body

Organization

application/json
  1. response
id*string
billingAccountId*string
name*string
slug*string
avatarUrl*|

URL of the organization's avatar image, hosted by Samva. Null when no avatar is set.

defaultRegion*|null
timezone*string
plan*string
isActive*boolean
createdAt*string
updatedAt*string
metadata*|null
replyToDefault*array<string>|null
emailFooterEnabledDefault*boolean|null
messagesUsed*number
messagesUsedThisMonth*number
smsUsed*number
smsUsedThisMonth*number
whatsappUsed*number
whatsappUsedThisMonth*number
emailUsed*number
emailUsedThisMonth*number
contactsUsed*number
conversationsUsed*number
teamMembersUsed*number
messagesResetAt*string|null
Example Request
import { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.organizations.update({});
Example Response
{  "id": "string",  "billingAccountId": "string",  "name": "string",  "slug": "string",  "avatarUrl": "string",  "defaultRegion": "string",  "timezone": "string",  "plan": "string",  "isActive": true,  "createdAt": "string",  "updatedAt": "string",  "metadata": {    "property1": "string",    "property2": "string"  },  "replyToDefault": [    "string"  ],  "emailFooterEnabledDefault": true,  "messagesUsed": 0,  "messagesUsedThisMonth": 0,  "smsUsed": 0,  "smsUsedThisMonth": 0,  "whatsappUsed": 0,  "whatsappUsedThisMonth": 0,  "emailUsed": 0,  "emailUsedThisMonth": 0,  "contactsUsed": 0,  "conversationsUsed": 0,  "teamMembersUsed": 0,  "messagesResetAt": "string"}

Related documentation