Salesforce Recent API

Retrieve recently viewed records for the current user.

Documentation

Specifications

Schemas & Data

OpenAPI Specification

salesforce-recent-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Salesforce Bulk API 2.0 Abort Recent API
  description: 'Salesforce Bulk API 2.0 is a simplified, REST-based interface for bulk data operations that improves on the original Bulk API. It uses a straightforward job model and supports CSV format for ingest and query jobs, enabling processing of millions of records asynchronously.

    '
  version: v63.0
  contact:
    name: Salesforce Developers
    url: https://developer.salesforce.com/
  license:
    name: Salesforce Developer Terms
    url: https://www.salesforce.com/company/legal/agreements/
servers:
- url: https://{instance}.salesforce.com/services/data/v{version}/jobs
  description: Salesforce Bulk API 2.0 jobs endpoint
  variables:
    instance:
      default: yourInstance
      description: 'The Salesforce instance identifier (e.g., na1, eu3, or a My Domain subdomain like mycompany).

        '
    version:
      default: '63.0'
      description: 'The Salesforce API version number (e.g., 63.0). Use the latest supported version for new integrations.

        '
security:
- BearerAuth: []
tags:
- name: Recent
  description: Retrieve recently viewed records for the current user.
paths:
  /recent:
    get:
      operationId: getRecentlyViewedRecords
      summary: Salesforce Get Recently Viewed Records
      description: 'Returns a list of recently viewed and referenced records for the currently authenticated user. Records are ordered by the most recently viewed first. Useful for building recently visited navigation features in custom applications.

        '
      tags:
      - Recent
      parameters:
      - name: recentlyViewedCount
        in: query
        required: false
        description: 'The number of recently viewed records to return. Defaults to 200. Maximum is 200.

          '
        schema:
          type: integer
          default: 200
          maximum: 200
        example: 42
      responses:
        '200':
          description: List of recently viewed records for the current user.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    Id:
                      type: string
                      description: 18-character Salesforce record ID.
                    Name:
                      type: string
                      description: Display name of the record.
                    attributes:
                      type: object
                      description: Object type and URL metadata.
                      properties:
                        type:
                          type: string
                          description: API name of the SObject type.
                        url:
                          type: string
                          format: uri
                          description: REST API URL for this record.
              examples:
                Getrecentlyviewedrecords200Example:
                  summary: Default getRecentlyViewedRecords 200 response
                  x-microcks-default: true
                  value:
                  - Id: abc123
                    Name: Example Title
                    attributes:
                      type: example_value
                      url: https://www.example.com
        '401':
          description: Unauthorized. Invalid or expired OAuth token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Getrecentlyviewedrecords401Example:
                  summary: Default getRecentlyViewedRecords 401 response
                  x-microcks-default: true
                  value:
                    message: example_value
                    errorCode: example_value
                    fields:
                    - example_value
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    Error:
      type: object
      description: 'An error response from the Salesforce REST API, describing the problem with the request.

        '
      properties:
        message:
          type: string
          description: Human-readable description of the error.
          example: example_value
        errorCode:
          type: string
          description: 'Salesforce error code (e.g., MALFORMED_QUERY, INVALID_FIELD, REQUIRED_FIELD_MISSING).

            '
          example: example_value
        fields:
          type: array
          description: 'List of field names related to the error, if applicable (e.g., for field validation errors).

            '
          items:
            type: string
          example: []
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'OAuth 2.0 Bearer token obtained from the Salesforce OAuth 2.0 token endpoint. Include this token in the Authorization header as "Bearer {access_token}".

        '