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

# Refresh content

> Asks Instagram for the account's newest posts and reels. inDM pulls posts on a
schedule rather than on demand, so a post published in the last few minutes is
often missing from [List media](/api-reference/media/list-media) while it already
exists on Instagram. This fetches it.

The refresh runs in the background. You get `202` with a `job_id` to poll with
[Get a refresh](/api-reference/accounts/get-refresh). Its `status` is `started`, or
`backfill` when the account's first full sync is still running and you were handed
that job instead. When the account synced within
the last minute there is nothing new to ask for, and you get `200` with
`status: "already_current"` instead.

Needs a `full` key.




## OpenAPI

````yaml post /accounts/{account_id}/refresh
openapi: 3.1.0
info:
  title: inDM API
  version: 1.0.0
  summary: >-
    Build, launch and read Instagram comment-to-DM automations from your own
    code.
  description: >
    The inDM API gives your code the same reach as the inDM app: list the posts
    and reels

    inDM has synced, pull in new ones, build automations on them, set them live
    and read

    how they are doing.


    Every request is authenticated with an API key created in **Settings → API
    keys**.

    Keys belong to one workspace and carry a scope, `read` or `full`. Keys are
    server-side

    secrets: the API sends no CORS headers, so a browser can't call it directly.


    Nothing sends through this API. No DM, broadcast or public reply leaves
    Instagram by

    this path, and every automation it creates starts as a `draft`. Setting one
    `live` is

    the only call that changes what people on Instagram receive.
  contact:
    name: inDM support
    email: support@indm.social
    url: https://docs.indm.social
servers:
  - url: https://api.indm.social/v1
    description: Production
security:
  - apiKey: []
tags:
  - name: Workspace
    description: The workspace and API key behind a request.
  - name: Accounts
    description: Connected Instagram accounts, their health, and content refreshes.
  - name: Media
    description: Posts and reels inDM has synced from Instagram.
  - name: Automations
    description: Comment-to-DM automations. Created as drafts; set live when you're ready.
paths:
  /accounts/{account_id}/refresh:
    post:
      tags:
        - Accounts
      summary: Refresh content
      description: >
        Asks Instagram for the account's newest posts and reels. inDM pulls
        posts on a

        schedule rather than on demand, so a post published in the last few
        minutes is

        often missing from [List media](/api-reference/media/list-media) while
        it already

        exists on Instagram. This fetches it.


        The refresh runs in the background. You get `202` with a `job_id` to
        poll with

        [Get a refresh](/api-reference/accounts/get-refresh). Its `status` is
        `started`, or

        `backfill` when the account's first full sync is still running and you
        were handed

        that job instead. When the account synced within

        the last minute there is nothing new to ask for, and you get `200` with

        `status: "already_current"` instead.


        Needs a `full` key.
      operationId: refreshAccount
      parameters:
        - $ref: '#/components/parameters/AccountId'
      responses:
        '200':
          description: >-
            The account synced within the last minute. Nothing was queued; read
            the media now.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefreshStart'
              example:
                status: already_current
        '202':
          description: A refresh is running. Poll it with its `job_id`.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefreshStart'
              example:
                job_id: 0b9e4c71-58d2-4f3a-b6e0-7a1d93c2e845
                status: started
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  parameters:
    AccountId:
      name: account_id
      in: path
      required: true
      description: >-
        The account `id` from [List
        accounts](/api-reference/accounts/list-accounts).
      schema:
        type: string
        format: uuid
      example: 6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10
  headers:
    X-Request-Id:
      description: >-
        A unique id for this request. Include it when you write to support and
        we can find the request at once.
      schema:
        type: string
      example: req_8Qm2ZcY4vN7tLp1K
    RateLimit-Limit:
      description: >-
        Requests this key may make per minute, across every route. Sent once the
        key is accepted.
      schema:
        type: integer
      example: 120
    RateLimit-Remaining:
      description: >-
        Requests left in the current one-minute window. `0` when a write is
        refused for the write limit.
      schema:
        type: integer
      example: 117
    RateLimit-Reset:
      description: Seconds until the current window resets.
      schema:
        type: integer
      example: 42
    Retry-After:
      description: Seconds to wait before trying again.
      schema:
        type: integer
      example: 18
  schemas:
    RefreshStart:
      type: object
      required:
        - status
      properties:
        job_id:
          type: string
          format: uuid
          description: >-
            The refresh job to poll with [Get a
            refresh](/api-reference/accounts/get-refresh). Left out when
            `status` is `already_current`.
        status:
          type: string
          enum:
            - started
            - backfill
            - already_current
          description: >
            `started`: a refresh is running; poll it. `backfill`: the account's
            first full

            sync is still running, and `job_id` is that sync. `already_current`:
            the account

            synced within the last minute, so nothing was queued; read the media
            now.
    Error:
      type: object
      description: Every error has this shape.
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - doc_url
          properties:
            type:
              type: string
              description: The family of error. Each maps to one HTTP status.
              enum:
                - invalid_request
                - authentication_error
                - permission_error
                - plan_limit
                - not_found
                - conflict
                - rate_limited
                - api_error
            code:
              type: string
              description: >
                A stable, specific code. Branch on this, never on `message`.
                Every code is

                listed on [Errors](/errors).
              example: dm_message_too_long
            message:
              type: string
              description: >-
                A sentence for a person, saying what happened and what to do
                next. It may change; don't parse it.
            param:
              type: string
              description: >-
                The request field the error is about. Left out when no single
                field is.
              example: dm_message
            doc_url:
              type: string
              format: uri
              description: A link to this code on the [Errors](/errors) page.
              example: https://docs.indm.social/errors#dm_message_too_long
  responses:
    Unauthorized:
      description: The API key is missing, malformed, expired or revoked.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: authentication_error
              code: api_key_expired
              message: >-
                This API key expired on 3 Feb 2027. Create a new one under
                Settings → API keys.
              doc_url: https://docs.indm.social/errors#api_key_expired
    Forbidden:
      description: >
        The key's scope doesn't cover this route (`permission_error`), or the
        workspace's

        plan doesn't include what this write needs (`plan_limit`).
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            insufficient_scope:
              summary: A read key on a write route
              value:
                error:
                  type: permission_error
                  code: insufficient_scope
                  message: >-
                    This key is read-only, and POST /v1/automations changes
                    things. Use a key with full access.
                  doc_url: https://docs.indm.social/errors#insufficient_scope
            plan_limit:
              summary: A write the plan doesn't include
              value:
                error:
                  type: plan_limit
                  code: followup_requires_paid_plan
                  message: >-
                    Follow-up messages send on Growth. Everything else in this
                    request can be saved without the follow-up.
                  param: followup_message
                  doc_url: https://docs.indm.social/errors#followup_requires_paid_plan
    NotFound:
      description: Nothing with that id exists in this key's workspace.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: not_found
              code: media_not_found
              message: >-
                There's no post with that id in this workspace. GET /v1/media
                lists them; refresh the account first if it was just published.
              param: media_id
              doc_url: https://docs.indm.social/errors#media_not_found
    Conflict:
      description: >-
        The request clashes with the current state, such as a second live
        automation on one post.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: conflict
              code: live_automation_on_media
              message: >-
                Another automation is already live on this post. Pause it first,
                so a fan who comments gets one DM.
              param: media_id
              doc_url: https://docs.indm.social/errors#live_automation_on_media
    RateLimited:
      description: >-
        This key went past its rate limit. Wait for `Retry-After` seconds, then
        try again.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: rate_limited
              code: rate_limited
              message: >-
                That's more than 120 requests a minute on one key. Wait 18s and
                try again.
              doc_url: https://docs.indm.social/errors#rate_limited
    ServerError:
      description: >
        Something failed on our side. Retrying with backoff is safe for reads.
        The same body

        comes with `503` when inDM briefly can't reach its database.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/X-Request-Id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: api_error
              code: internal_error
              message: >-
                Something went wrong on our end. Try again; if it keeps
                happening, quote request req_8Qm2ZcY4vN7tLp1K to
                support@indm.social.
              doc_url: https://docs.indm.social/errors#internal_error
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: indm_ API key
      description: >
        An API key from **Settings → API keys** in the inDM app, sent as

        `Authorization: Bearer indm_...`. Keys belong to one workspace and carry
        a scope:

        `read` for GET routes and the validate dry run, `full` for everything.
        Keep keys on

        your server; never ship one to a browser or a mobile app.

````

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