Salesforce Composite API

The Composite API executes a series of REST API requests in a single POST request, or retrieves a list of other composite resources with a GET request. There are three types of Composite requests sometime referred to as APIs: - [Composite](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_composite.htm) (the original) - [Composite Batch](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_batch.htm) - [Composite Graph](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_graph.htm) (the most recent)

Operations 2

POST /data/v64.0/composite Salesforce Composite #
POST /data/v64.0/composite/graph Salesforce Composite Graph #

Documentation

Specifications

Schemas & Data

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/salesforce-composite-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

salesforce-composite-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Salesforce Composite API
  description: 'Find the resources you need to start building. '
  contact: {}
  version: '1.0'
servers:
- url: https://login.salesforce.com
  variables: {}
- url: https://id
  variables: {}
- url: https://services
  variables: {}
- url: '{{url}}{{site}}/services/oauth2'
  variables:
    url:
      default: DefaultParameterValue
    site:
      default: DefaultParameterValue
security:
- oauth2:
  - api
tags:
- name: Composite
  description: 'The Composite API executes a series of REST API requests in a single POST request, or retrieves a list of other composite resources with a GET request.


    There are three types of Composite requests sometime referred to as APIs:

    - [Composite](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_composite.htm) (the original)

    - [Composite Batch](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_batch.htm)

    - [Composite Graph](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_graph.htm) (the most recent)'
paths:
  /data/v64.0/composite:
    parameters: []
    post:
      tags:
      - Composite
      summary: Salesforce Composite
      description: 'Executes a series of REST API requests in a single call. You can use the output of one request as the input to a subsequent request. The response bodies and HTTP statuses of the requests are returned in a single response body. The entire request counts as a single call toward your API limits.

        The requests in a composite call are called subrequests. All subrequests are executed in the context of the same user. In a subrequest’s body, you specify a reference ID that maps to the subrequest’s response. You can then refer to the ID in the url or body fields of later subrequests by using a JavaScript-like reference notation.


        https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_composite.htm'
      operationId: Composite
      parameters:
      - name: Authorization
        in: header
        description: Only used for Postman Notebooks. Auth is defined at collection-level and inherited down.
        required: true
        schema:
          type: string
        example: example_value
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/CompositeRequest'
              - examples:
                - compositeRequest:
                  - method: POST
                    url: /services/data/v64.0/sobjects/Account
                    referenceId: refAccount
                    body:
                      Name: Sample Account
                  - method: POST
                    url: /services/data/v64.0/sobjects/Contact
                    referenceId: refContact
                    body:
                      LastName: Sample Contact
                      AccountId: '@{refAccount.id}'
              contentMediaType: application/json
            example:
              compositeRequest:
              - method: POST
                url: /services/data/v64.0/sobjects/Account
                referenceId: refAccount
                body:
                  Name: Sample Account
              - method: POST
                url: /services/data/v64.0/sobjects/Contact
                referenceId: refContact
                body:
                  LastName: Sample Contact
                  AccountId: '@{refAccount.id}'
        required: true
      responses:
        '200':
          description: OK
          headers:
            Date:
              content:
                text/plain:
                  schema:
                    type: string
                    contentMediaType: text/plain
                  example: Mon, 20 Nov 2023 15:18:26 GMT
            Strict-Transport-Security:
              content:
                text/plain:
                  schema:
                    type: string
                    contentMediaType: text/plain
                  example: max-age=63072000; includeSubDomains
            X-Content-Type-Options:
              content:
                text/plain:
                  schema:
                    type: string
                    contentMediaType: text/plain
                  example: nosniff
            X-XSS-Protection:
              content:
                text/plain:
                  schema:
                    type: string
                    contentMediaType: text/plain
                  example: 1; mode=block
            X-Robots-Tag:
              content:
                text/plain:
                  schema:
                    type: string
                    contentMediaType: text/plain
                  example: none
            Cache-Control:
              content:
                text/plain:
                  schema:
                    type: string
                    contentMediaType: text/plain
                  example: no-cache,must-revalidate,max-age=0,no-store,private
            Sforce-Limit-Info:
              content:
                text/plain:
                  schema:
                    type: string
                    contentMediaType: text/plain
                  example: api-usage=33/15000
            Vary:
              content:
                text/plain:
                  schema:
                    type: string
                    contentMediaType: text/plain
                  example: Accept-Encoding
            Content-Encoding:
              content:
                text/plain:
                  schema:
                    type: string
                    contentMediaType: text/plain
                  example: gzip
            Transfer-Encoding:
              content:
                text/plain:
                  schema:
                    type: string
                    contentMediaType: text/plain
                  example: chunked
          content:
            application/json;charset=UTF-8:
              schema:
                allOf:
                - $ref: '#/components/schemas/SuccessfulComposite'
                - examples:
                  - compositeResponse:
                    - body:
                        id: 001...
                        success: true
                        errors: []
                      httpHeaders:
                        Location: /services/data/v53.0/sobjects/Account/001...
                      httpStatusCode: 201
                      referenceId: refAccount
                    - body:
                        id: 0032o00003WauzJAAR
                        success: true
                        errors: []
                      httpHeaders:
                        Location: /services/data/v53.0/sobjects/Contact/003...
                      httpStatusCode: 201
                      referenceId: refContact
                contentMediaType: application/json;charset=UTF-8
              example:
                compositeResponse:
                - body:
                    id: 001...
                    success: true
                    errors: []
                  httpHeaders:
                    Location: /services/data/v53.0/sobjects/Account/001...
                  httpStatusCode: 201
                  referenceId: refAccount
                - body:
                    id: 0032o00003WauzJAAR
                    success: true
                    errors: []
                  httpHeaders:
                    Location: /services/data/v53.0/sobjects/Contact/003...
                  httpStatusCode: 201
                  referenceId: refContact
      deprecated: false
      security: []
      servers:
      - url: https://services
        variables: {}
      x-api-evangelist-processing:
        PascalCaseOperationSummaries: true
        ChooseTags: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /data/v64.0/composite/graph:
    parameters: []
    post:
      tags:
      - Composite
      summary: Salesforce Composite Graph
      description: 'Composite graphs provide an enhanced way to perform composite requests, which execute a series of REST API requests in a single call.

        Regular composite requests allow you to execute a series of REST API requests in a single call. And you can use the output of one request as the input to a subsequent request.


        Composite graphs extend this by allowing you to assemble a more complicated and complete series of related objects and records.


        Composite graphs also enable you to ensure that the steps in a given set of operations are either all completed or all not completed. This avoids requiring you to check for a mix of successful and unsuccessful results.


        Regular composite requests have a limit of 25 subrequests. Composite graphs increase this limit to 500. This gives a single API call much greater power.


        https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_graph_introduction.htm'
      operationId: CompositeGraph
      parameters: []
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/CompositeGraphRequest'
              - examples:
                - graphs:
                  - graphId: graph1
                    compositeRequest:
                    - method: POST
                      url: /services/data/v64.0/sobjects/Account/
                      referenceId: newAccount
                      body:
                        Name: ACME Inc.
                        Custom__c: Hello world
                    - method: GET
                      url: /services/data/v64.0/sobjects/Account/@{newAccount.id}
                      referenceId: newAccountInfo
              contentMediaType: application/json
            example:
              graphs:
              - graphId: graph1
                compositeRequest:
                - method: POST
                  url: /services/data/v64.0/sobjects/Account/
                  referenceId: newAccount
                  body:
                    Name: ACME Inc.
                    Custom__c: Hello world
                - method: GET
                  url: /services/data/v64.0/sobjects/Account/@{newAccount.id}
                  referenceId: newAccountInfo
        required: true
      responses:
        '200':
          description: OK
          headers:
            cache-control:
              content:
                text/plain:
                  schema:
                    type: string
                    contentMediaType: text/plain
                  example: no-cache,must-revalidate,max-age=0,no-store,private
            content-type:
              content:
                text/plain:
                  schema:
                    type: string
                    contentMediaType: text/plain
                  example: application/json;charset=UTF-8
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/SuccessfulCompositeGraph'
                - examples:
                  - graphs:
                    - graphId: graph1
                      graphResponse:
                        compositeResponse:
                        - body:
                            id: 0014H00002x6HUhQAM
                            success: true
                            errors: []
                          httpHeaders:
                            Location: /services/data/v50.0/sobjects/Account/0014H00002x6HUhQAM
                          httpStatusCode: 201
                          referenceId: newAccount
                        - body:
                            id: 0034H00002JsInQQAV
                            success: true
                            errors: []
                          httpHeaders:
                            Location: /services/data/v50.0/sobjects/Contact/0034H00002JsInQQAV
                          httpStatusCode: 201
                          referenceId: newContact
                      isSuccessful: true
                contentMediaType: application/json
              example:
                graphs:
                - graphId: graph1
                  graphResponse:
                    compositeResponse:
                    - body:
                        id: 0014H00002x6HUhQAM
                        success: true
                        errors: []
                      httpHeaders:
                        Location: /services/data/v50.0/sobjects/Account/0014H00002x6HUhQAM
                      httpStatusCode: 201
                      referenceId: newAccount
                    - body:
                        id: 0034H00002JsInQQAV
                        success: true
                        errors: []
                      httpHeaders:
                        Location: /services/data/v50.0/sobjects/Contact/0034H00002JsInQQAV
                      httpStatusCode: 201
                      referenceId: newContact
                  isSuccessful: true
      deprecated: false
      servers:
      - url: https://services
        variables: {}
      x-api-evangelist-processing:
        PascalCaseOperationSummaries: true
        ChooseTags: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    CompositeRequest:
      title: CompositeRequest
      required:
      - compositeRequest
      type: object
      properties:
        compositeRequest:
          type: array
          items:
            $ref: '#/components/schemas/CompositeRequest1'
          description: ''
          example: []
      examples:
      - compositeRequest:
        - method: POST
          url: /services/data/v64.0/sobjects/Account
          referenceId: refAccount
          body:
            Name: Sample Account
        - method: POST
          url: /services/data/v64.0/sobjects/Contact
          referenceId: refContact
          body:
            LastName: Sample Contact
            AccountId: '@{refAccount.id}'
    SuccessfulComposite:
      title: SuccessfulComposite
      required:
      - compositeResponse
      type: object
      properties:
        compositeResponse:
          type: array
          items:
            $ref: '#/components/schemas/CompositeResponse'
          description: ''
          example: []
      examples:
      - compositeResponse:
        - body:
            id: 001...
            success: true
            errors: []
          httpHeaders:
            Location: /services/data/v53.0/sobjects/Account/001...
          httpStatusCode: 201
          referenceId: refAccount
        - body:
            id: 0032o00003WauzJAAR
            success: true
            errors: []
          httpHeaders:
            Location: /services/data/v53.0/sobjects/Contact/003...
          httpStatusCode: 201
          referenceId: refContact
    CompositeRequest1:
      title: CompositeRequest1
      required:
      - method
      - url
      - referenceId
      - body
      type: object
      properties:
        method:
          type: string
          example: example_value
        url:
          type: string
          example: https://www.example.com
        referenceId:
          type: string
          example: '500123'
        body:
          $ref: '#/components/schemas/Body'
      examples:
      - method: POST
        url: /services/data/v64.0/sobjects/Account
        referenceId: refAccount
        body:
          Name: Sample Account
    Body:
      title: Body
      type: object
      properties:
        Name:
          type: string
          example: Example Title
        LastName:
          type: string
          example: example_value
        AccountId:
          type: string
          example: '500123'
      examples:
      - Name: Sample Account
    GraphResponse:
      title: GraphResponse
      required:
      - compositeResponse
      type: object
      properties:
        compositeResponse:
          type: array
          items:
            $ref: '#/components/schemas/CompositeResponse'
          description: ''
          example: []
      examples:
      - compositeResponse:
        - body:
            id: 0014H00002x6HUhQAM
            success: true
            errors: []
          httpHeaders:
            Location: /services/data/v50.0/sobjects/Account/0014H00002x6HUhQAM
          httpStatusCode: 201
          referenceId: newAccount
        - body:
            id: 0034H00002JsInQQAV
            success: true
            errors: []
          httpHeaders:
            Location: /services/data/v50.0/sobjects/Contact/0034H00002JsInQQAV
          httpStatusCode: 201
          referenceId: newContact
    Graph:
      title: Graph
      required:
      - graphId
      - compositeRequest
      type: object
      properties:
        graphId:
          type: string
          example: '500123'
        compositeRequest:
          type: array
          items:
            $ref: '#/components/schemas/CompositeRequest2'
          description: ''
          example: []
      examples:
      - graphId: graph1
        compositeRequest:
        - method: POST
          url: /services/data/v64.0/sobjects/Account/
          referenceId: newAccount
          body:
            Name: ACME Inc.
            Custom__c: Hello world
        - method: GET
          url: /services/data/v64.0/sobjects/Account/@{newAccount.id}
          referenceId: newAccountInfo
    CompositeRequest2:
      title: CompositeRequest2
      required:
      - method
      - url
      - referenceId
      type: object
      properties:
        method:
          type: string
          example: example_value
        url:
          type: string
          example: https://www.example.com
        referenceId:
          type: string
          example: '500123'
        body:
          $ref: '#/components/schemas/Body2'
      examples:
      - method: POST
        url: /services/data/v64.0/sobjects/Account/
        referenceId: newAccount
        body:
          Name: ACME Inc.
          Custom__c: Hello world
    Graph1:
      title: Graph1
      required:
      - graphId
      - graphResponse
      - isSuccessful
      type: object
      properties:
        graphId:
          type: string
          example: '500123'
        graphResponse:
          $ref: '#/components/schemas/GraphResponse'
        isSuccessful:
          type: boolean
          example: true
      examples:
      - graphId: graph1
        graphResponse:
          compositeResponse:
          - body:
              id: 0014H00002x6HUhQAM
              success: true
              errors: []
            httpHeaders:
              Location: /services/data/v50.0/sobjects/Account/0014H00002x6HUhQAM
            httpStatusCode: 201
            referenceId: newAccount
          - body:
              id: 0034H00002JsInQQAV
              success: true
              errors: []
            httpHeaders:
              Location: /services/data/v50.0/sobjects/Contact/0034H00002JsInQQAV
            httpStatusCode: 201
            referenceId: newContact
        isSuccessful: true
    Body2:
      title: Body2
      required:
      - Name
      - Custom__c
      type: object
      properties:
        Name:
          type: string
          example: Example Title
        Custom__c:
          type: string
          example: example_value
      examples:
      - Name: ACME Inc.
        Custom__c: Hello world
    Body1:
      title: Body1
      required:
      - id
      - success
      - errors
      type: object
      properties:
        id:
          type: string
          example: abc123
        success:
          type: boolean
          example: true
        errors:
          type: array
          items:
            type: string
          description: ''
          example: []
      examples:
      - id: 001...
        success: true
        errors: []
    SuccessfulCompositeGraph:
      title: SuccessfulCompositeGraph
      required:
      - graphs
      type: object
      properties:
        graphs:
          type: array
          items:
            $ref: '#/components/schemas/Graph1'
          description: ''
          example: []
      examples:
      - graphs:
        - graphId: graph1
          graphResponse:
            compositeResponse:
            - body:
                id: 0014H00002x6HUhQAM
                success: true
                errors: []
              httpHeaders:
                Location: /services/data/v50.0/sobjects/Account/0014H00002x6HUhQAM
              httpStatusCode: 201
              referenceId: newAccount
            - body:
                id: 0034H00002JsInQQAV
                success: true
                errors: []
              httpHeaders:
                Location: /services/data/v50.0/sobjects/Contact/0034H00002JsInQQAV
              httpStatusCode: 201
              referenceId: newContact
          isSuccessful: true
    CompositeResponse:
      title: CompositeResponse
      required:
      - body
      - httpHeaders
      - httpStatusCode
      - referenceId
      type: object
      properties:
        body:
          $ref: '#/components/schemas/Body1'
        httpHeaders:
          $ref: '#/components/schemas/HttpHeaders'
        httpStatusCode:
          type: integer
          contentEncoding: int32
          example: 10
        referenceId:
          type: string
          example: '500123'
      examples:
      - body:
          id: 001...
          success: true
          errors: []
        httpHeaders:
          Location: /services/data/v53.0/sobjects/Account/001...
        httpStatusCode: 201
        referenceId: refAccount
    CompositeGraphRequest:
      title: CompositeGraphRequest
      required:
      - graphs
      type: object
      properties:
        graphs:
          type: array
          items:
            $ref: '#/components/schemas/Graph'
          description: ''
          example: []
      examples:
      - graphs:
        - graphId: graph1
          compositeRequest:
          - method: POST
            url: /services/data/v64.0/sobjects/Account/
            referenceId: newAccount
            body:
              Name: ACME Inc.
              Custom__c: Hello world
          - method: GET
            url: /services/data/v64.0/sobjects/Account/@{newAccount.id}
            referenceId: newAccountInfo
    HttpHeaders:
      title: HttpHeaders
      required:
      - Location
      type: object
      properties:
        Location:
          type: string
          example: example_value
      examples:
      - Location: /services/data/v53.0/sobjects/Account/001...
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: '{DefaultParameterValue}{DefaultParameterValue}/services/oauth2/authorize'
          scopes:
            api: ''