> ## Documentation Index
> Fetch the complete documentation index at: https://docs.suprsend.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create / Update Objects

> API to upsert (create if not exists, update if exists) object by providing a unique object ID and type.



## OpenAPI

````yaml POST /v1/object/{object_type}/{id}/
openapi: 3.1.1
info:
  title: SuprSend API
  description: APIs supported on suprsend platform
  version: 1.2.2
servers:
  - url: https://hub.suprsend.com
security:
  - sec0: []
  - BearerAuth: []
paths:
  /v1/object/{object_type}/{id}/:
    post:
      summary: Create / Update Objects
      description: >-
        API to upsert (create if not exists, update if exists) object by
        providing a unique object ID and type.
      operationId: create-update-objects
      parameters:
        - name: id
          in: path
          description: Unique identifier of the object in your system
          schema:
            type: string
          required: true
        - name: object_type
          in: path
          description: >-
            Used to group similar objects together. Give plural namespace like
            teams, organizations, and roles.
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            example:
              department: Engineering
              $email:
                - devs@example.com
              $slack:
                - channel: CXXXXXXXX
                  access_token: xoxb-XXXXXX
            schema:
              properties:
                $email:
                  type: array
                  items:
                    type: string
                    format: email
                  description: List of email addresses.
                $sms:
                  type: array
                  items:
                    type: string
                  description: List of phone numbers for SMS
                $whatsapp:
                  type: array
                  items:
                    type: string
                  description: List of phone numbers for WhatsApp
                $inbox:
                  type: array
                  items:
                    type: string
                  description: List of inbox identifiers
                $androidpush:
                  type: array
                  items:
                    type: string
                  description: List of Android Push tokens
                $iospush:
                  type: array
                  items:
                    type: string
                  description: List of iOS Push tokens
                $slack:
                  type: array
                  description: Slack channel configuration
                  items:
                    oneOf:
                      - type: object
                        title: Slack using email
                        required:
                          - email
                          - access_token
                        properties:
                          email:
                            type: string
                            format: email
                            description: User email address
                            example: user@example.com
                          access_token:
                            type: string
                            description: Slack bot access token
                            example: xoxb-XXXXXXXX
                      - type: object
                        title: Slack using member ID
                        required:
                          - user_id
                          - access_token
                        properties:
                          user_id:
                            type: string
                            description: Slack user ID (U/WXXXXXXXX format)
                            example: U/WXXXXXXXX
                          access_token:
                            type: string
                            description: Slack bot access token
                            example: xoxb-XXXXXX
                      - type: object
                        title: Slack using channel
                        required:
                          - channel
                          - access_token
                        properties:
                          channel:
                            type: string
                            description: Slack channel ID (CXXXXXXXX format)
                            example: CXXXXXXXX
                          access_token:
                            type: string
                            description: Slack bot access token
                            example: xoxb-XXXXXX
                      - type: object
                        title: Slack using incoming webhook
                        required:
                          - incoming_webhook
                        properties:
                          incoming_webhook:
                            type: object
                            required:
                              - url
                            properties:
                              url:
                                type: string
                                format: uri
                                description: Slack incoming webhook URL
                                example: >-
                                  https://hooks.slack.com/services/TXXXX/BXXXX/XXXXXXX
                $ms_teams:
                  type: array
                  description: Microsoft Teams channel configuration
                  items:
                    oneOf:
                      - type: object
                        title: MS Teams using conversation ID
                        required:
                          - tenant_id
                          - service_url
                          - conversation_id
                        properties:
                          tenant_id:
                            type: string
                            description: Microsoft Teams tenant ID
                            example: c1981ab2-9aaf-xxxx-xxxx
                          service_url:
                            type: string
                            format: uri
                            description: Microsoft Teams service URL
                            example: https://smba.trafficmanager.net/amer
                          conversation_id:
                            type: string
                            description: Microsoft Teams conversation ID
                            example: 19:c1524d7c-a06f-456f-8abe-xxxx
                      - type: object
                        title: MS Teams using user ID
                        required:
                          - tenant_id
                          - service_url
                          - user_id
                        properties:
                          tenant_id:
                            type: string
                            description: Microsoft Teams tenant ID
                            example: c1981ab2-9aaf-xxxx-xxxx
                          service_url:
                            type: string
                            format: uri
                            description: Microsoft Teams service URL
                            example: https://smba.trafficmanager.net/amer
                          user_id:
                            type: string
                            description: Microsoft Teams user ID
                            example: 29:1nsLcmJ2RKtYH6Cxxxx-xxxx
                      - type: object
                        title: MS Teams using incoming webhook
                        required:
                          - incoming_webhook
                        properties:
                          incoming_webhook:
                            type: object
                            required:
                              - url
                            properties:
                              url:
                                type: string
                                format: uri
                                description: Microsoft Teams incoming webhook URL
                                example: >-
                                  https://wnk1z.webhook.office.com/webhookb2/XXXXXXXXX
                $timezone:
                  type: string
                  description: >-
                    Object's timezone in [IANA
                    format](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List)
                  example: America/New_York
                $locale:
                  type: string
                  description: >-
                    Object's locale for
                    [translating](https://suprsend.com/docs/translations)
                    template content in SuprSend.
                  example: en_GB
      responses:
        '201':
          description: 201 - Created
          content:
            application/json:
              examples:
                Result:
                  value:
                    object_type: departments
                    id: engineering
                    subscriptions_count: 0
                    properties:
                      $locale: en_GB
                      department: Engineering
                    created_at: '2025-04-06T10:00:37.893892+00:00'
                    updated_at: '2025-04-06T10:00:37.893892+00:00'
                    $email:
                      - value: devs@example.com
                        status: active
                        perma_status: active
                    $slack:
                      - value:
                          email_id: user@example.com
                          access_token: xoxb-...
                        status: active
                        perma_status: active
                    $inbox:
                      - value: pO7w6x_HFZxCs30N4SHab05e3QIdB1e0xT2r4vQWjvM
                        id_provider: suprsend
                        status: active
                        perma_status: active
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: unique identifier of the object
                    example: engineering
                  object_type:
                    type: string
                    description: >-
                      Used to group similar objects together. Give plural
                      namespace like teams, organizations, and roles.
                    example: departments
                  subscriptions_count:
                    type: integer
                    description: number of users/child objects subscribed to the object
                    example: departments
                  properties:
                    type: object
                    description: >-
                      all user properties in key-value pair. SuprSend reserved
                      properties start with $
                  created_at:
                    type: string
                    format: date-time
                    example: '2025-04-04T09:55:12.397Z'
                  updated_at:
                    type: string
                    format: date-time
                    example: '2025-04-04T09:55:12.422Z'
                  $<channel>:
                    type: array
                    items:
                      type: object
                      properties:
                        value:
                          type: string
                          description: channel value
                        status:
                          type: string
                          example: active
                        perma_status:
                          type: string
                          description: >-
                            active/disabled. Perma_status is marked disabled in
                            case of hard bounce on the channel.
        '400':
          description: 400 - Bad Request
          content:
            application/json:
              examples:
                Result:
                  value:
                    code: 400
                    message: invalid_request_error
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 400
                  message:
                    type: string
                    description: Error message describing the missing resource.
      deprecated: false
      security:
        - BearerAuth: []
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where <token>
        is your auth token.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API_Key
      description: >-
        Pass as `Bearer <API_KEY>`. Get API Key from SuprSend dashboard
        Developers -> API Keys section.

````

Built with [Mintlify](https://mintlify.com).