Render One-Off Jobs API

[One-off jobs](https://render.com/docs/one-off-jobs) are standalone tasks that run to completion using the most recent successful build of an existing service.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

render-one-off-jobs-api-openapi.yml Raw ↑
openapi: 3.0.2
info:
  title: Render Public Audit Logs One-Off Jobs API
  description: Manage everything about your Render services
  version: 1.0.0
  contact:
    name: Render API
    url: https://community.render.com
    email: support@render.com
servers:
- url: https://api.render.com/v1
security:
- BearerAuth: []
tags:
- name: One-Off Jobs
  description: '[One-off jobs](https://render.com/docs/one-off-jobs) are standalone tasks that run to completion using the most recent successful build of an existing service.

    '
paths:
  /services/{serviceId}/jobs:
    parameters:
    - $ref: '#/components/parameters/serviceIdParam'
    get:
      summary: List jobs
      description: 'List jobs for the provided service that match the provided filters. If no filters are provided, all jobs for the service are returned.

        '
      operationId: list-job
      tags:
      - One-Off Jobs
      parameters:
      - $ref: '#/components/parameters/cursorParam'
      - $ref: '#/components/parameters/limitParam'
      - name: status
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - pending
            - running
            - succeeded
            - failed
            - canceled
        style: form
        explode: false
        required: false
        description: Filter for the status of the job (`pending`, `running`, `succeeded`, `failed`, or `canceled`)
      - name: createdBefore
        in: query
        schema:
          type: string
          format: date-time
        required: false
        description: Filter for jobs created before a certain time (specified as an ISO 8601 timestamp)
        example: '2021-06-17T08:15:30Z'
      - name: createdAfter
        in: query
        schema:
          type: string
          format: date-time
        required: false
        description: Filter for jobs created after a certain time (specified as an ISO 8601 timestamp)
        example: '2021-02-17T08:15:30Z'
      - name: startedBefore
        in: query
        schema:
          type: string
          format: date-time
        required: false
        description: Filter for jobs started before a certain time (specified as an ISO 8601 timestamp)
        example: '2021-06-17T08:15:30Z'
      - name: startedAfter
        in: query
        schema:
          type: string
          format: date-time
        required: false
        description: Filter for jobs started after a certain time (specified as an ISO 8601 timestamp)
        example: '2021-02-17T08:15:30Z'
      - name: finishedBefore
        in: query
        schema:
          type: string
          format: date-time
        required: false
        description: Filter for jobs finished before a certain time (specified as an ISO 8601 timestamp)
        example: '2021-06-17T08:15:30Z'
      - name: finishedAfter
        in: query
        schema:
          type: string
          format: date-time
        required: false
        description: Filter for jobs finished after a certain time (specified as an ISO 8601 timestamp)
        example: '2021-02-17T08:15:30Z'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/jobWithCursor'
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          $ref: '#/components/responses/401Unauthorized'
        '404':
          $ref: '#/components/responses/404NotFound'
        '429':
          $ref: '#/components/responses/429RateLimit'
        '500':
          $ref: '#/components/responses/500InternalServerError'
        '503':
          $ref: '#/components/responses/503ServiceUnavailable'
    post:
      summary: Create job
      description: 'Create a one-off job using the provided service. For details, see [One-Off Jobs](https://render.com/docs/one-off-jobs).

        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - startCommand
              properties:
                startCommand:
                  type: string
                planId:
                  type: string
      operationId: post-job
      tags:
      - One-Off Jobs
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/jobWithCursor/properties/job'
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          $ref: '#/components/responses/401Unauthorized'
        '404':
          $ref: '#/components/responses/404NotFound'
        '429':
          $ref: '#/components/responses/429RateLimit'
        '500':
          $ref: '#/components/responses/500InternalServerError'
        '503':
          $ref: '#/components/responses/503ServiceUnavailable'
  /services/{serviceId}/jobs/{jobId}:
    parameters:
    - $ref: '#/components/parameters/serviceIdParam'
    - name: jobId
      in: path
      required: true
      description: The ID of the job
      schema:
        type: string
        pattern: ^job-[0-9a-z]{20}$
        example: job-cph1rs3idesc73a2b2mg
    get:
      summary: Retrieve job
      description: 'Retrieve the details of a particular one-off job for a particular service.

        '
      operationId: retrieve-job
      tags:
      - One-Off Jobs
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/jobWithCursor/properties/job'
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          $ref: '#/components/responses/401Unauthorized'
        '404':
          $ref: '#/components/responses/404NotFound'
        '429':
          $ref: '#/components/responses/429RateLimit'
        '500':
          $ref: '#/components/responses/500InternalServerError'
        '503':
          $ref: '#/components/responses/503ServiceUnavailable'
  /services/{serviceId}/jobs/{jobId}/cancel:
    parameters:
    - $ref: '#/components/parameters/serviceIdParam'
    - $ref: '#/paths/~1services~1%7BserviceId%7D~1jobs~1%7BjobId%7D/parameters/1'
    post:
      summary: Cancel running job
      description: 'Cancel a particular one-off job for a particular service.

        '
      operationId: cancel-job
      tags:
      - One-Off Jobs
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/jobWithCursor/properties/job'
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          $ref: '#/components/responses/401Unauthorized'
        '404':
          $ref: '#/components/responses/404NotFound'
        '429':
          $ref: '#/components/responses/429RateLimit'
        '500':
          $ref: '#/components/responses/500InternalServerError'
        '503':
          $ref: '#/components/responses/503ServiceUnavailable'
components:
  responses:
    429RateLimit:
      description: Rate limit has been surpassed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
    500InternalServerError:
      description: An unexpected server error has occurred.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
    404NotFound:
      description: Unable to find the requested resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
    401Unauthorized:
      description: Authorization information is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
    503ServiceUnavailable:
      description: Server currently unavailable.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
    400BadRequest:
      description: The request could not be understood by the server.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
  parameters:
    serviceIdParam:
      name: serviceId
      in: path
      required: true
      description: The ID of the service
      schema:
        type: string
    limitParam:
      name: limit
      in: query
      required: false
      description: The maximum number of items to return. For details, see [Pagination](https://api-docs.render.com/reference/pagination).
      schema:
        type: integer
        default: 20
        minimum: 1
        maximum: 100
        description: Defaults to 20
    cursorParam:
      name: cursor
      in: query
      required: false
      description: The position in the result list to start from when fetching paginated results. For details, see [Pagination](https://api-docs.render.com/reference/pagination).
      schema:
        type: string
  schemas:
    error:
      type: object
      properties:
        id:
          type: string
        message:
          type: string
    jobWithCursor:
      type: object
      required:
      - job
      - cursor
      properties:
        job:
          type: object
          required:
          - id
          - serviceId
          - startCommand
          - planId
          - createdAt
          properties:
            id:
              $ref: '#/paths/~1services~1%7BserviceId%7D~1jobs~1%7BjobId%7D/parameters/1/schema'
            serviceId:
              type: string
              example: srv-xxxxx
            startCommand:
              type: string
              example: echo 'hello world'
            planId:
              type: string
              example: plan-srv-004
            status:
              $ref: '#/paths/~1services~1%7BserviceId%7D~1jobs/get/parameters/2/schema/items'
            createdAt:
              type: string
              format: date-time
              example: '2021-07-15T07:20:05.777035-07:00'
            startedAt:
              type: string
              format: date-time
              example: '2021-07-15T07:20:05.777035-07:00'
            finishedAt:
              type: string
              format: date-time
              example: '2021-07-15T07:20:05.777035-07:00'
        cursor:
          $ref: '#/components/schemas/cursor'
    cursor:
      type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
x-readme:
  metrics-enabled: false