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

# Poll certificate status

> This endpoint checks the status of a certificate generation job. Jobs expire 24 hours after they are requested, after which this endpoint returns `404`.

This is step 2 of 3. Once complete, [download the PDF](/download-certificate) from `url`. See [Certificates](/certificates) for the full process.




## OpenAPI

````yaml /openapi.yaml get /certificates/status/{job_id}
openapi: 3.1.0
info:
  title: Tribal Habits Public API
  version: '1'
  description: >
    The Tribal Habits Public API V1. Use it to manage your Tribal Habits user
    accounts (list, show, create and update) and other entities.


    Replace `myorg` in the server URL with your organisation's subdomain. See
    [Vanity URL](/vanity-url) if you use your own domain.
servers:
  - url: https://myorg.tribalhabits.com/papi
security:
  - ApiKeyHeader: []
tags:
  - name: Users
    description: Users
  - name: Topics
    description: Topics
  - name: Pathways
    description: Pathways
  - name: Enrolments
    description: Topic and Pathway Enrolments
  - name: Certificates
    description: >-
      Certificate generation and retrieval for completed topic and pathway
      enrolments.
  - name: External Knowledge
    description: Knowledge obtained from a source external of Tribal Habits.
  - name: Webhooks
    description: >-
      Webhooks triggered from certain actions in code that will call URLs
      assigned by you.
paths:
  /certificates/status/{job_id}:
    get:
      tags:
        - Certificates
      summary: Poll certificate status
      description: >
        This endpoint checks the status of a certificate generation job. Jobs
        expire 24 hours after they are requested, after which this endpoint
        returns `404`.


        This is step 2 of 3. Once complete, [download the
        PDF](/download-certificate) from `url`. See
        [Certificates](/certificates) for the full process.
      operationId: getCertificateStatus
      parameters:
        - name: job_id
          in: path
          required: true
          description: >-
            The certificate job identifier returned from `GET
            /papi/certificates`
          schema:
            type: string
          example: cert_abc123xyz
      responses:
        '200':
          description: >-
            OK - Job finished (`status` `complete` with `url`, or `status`
            `failed` with `error`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CertificateJob'
              examples:
                complete:
                  summary: Complete
                  value:
                    job_id: cert_abc123xyz
                    status: complete
                    url: >-
                      https://s3.ap-southeast-2.amazonaws.com/bucket/tenants/org/certificates/cert_abc123xyz.pdf?X-Amz-...
                failed:
                  summary: Failed
                  value:
                    job_id: cert_abc123xyz
                    status: failed
                    error: Certificate could not be generated.
        '202':
          description: Accepted - Job is still processing (`status` `pending`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CertificateJob'
              example:
                job_id: cert_abc123xyz
                status: pending
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Not Found - Job does not exist or belongs to another organisation
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    CertificateJob:
      type: object
      properties:
        job_id:
          type: string
          description: The certificate job identifier
        status:
          type: string
          enum:
            - pending
            - complete
            - failed
        url:
          type: string
          description: >-
            Present when `status` is `complete`. Temporary pre-signed URL of the
            certificate PDF. It expires after 15 minutes. See [Download
            certificate PDF](/download-certificate)
        error:
          type: string
          description: Present when `status` is `failed`
  responses:
    Unauthorized:
      description: >-
        Unauthorized - The request does not include the API key, the API key is
        incorrect, or API access is not enabled on your plan.
    TooManyRequests:
      description: >-
        Too Many Requests - You have exceeded the rate limit. See [Rate
        limits](/rate-limits)
      headers:
        Retry-After:
          description: Number of seconds until the rate limit window resets
          schema:
            type: integer
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
              retry_after_seconds:
                type: integer
          example:
            error: Rate limit exceeded. Please slow down.
            retry_after_seconds: 23
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: Authorization
      description: >
        Your organisation's API key, sent as `Authorization: my_api_key`. The
        key can also be passed as an `api_key` query parameter. See
        [Authentication](/authentication).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.