Archive API docs
    Jump to

    Narrow by kind with a prefix — q: queries, m: mutations, t: types, g: guides, f: fields and arguments.

    Example prompts

    Try these prompts after connecting Archive. Each example lists the tools the agent should use so you can check its work in the tool log.

    Surface top content

    “Show me our 10 most-viewed TikTok posts from the last 30 days, with a link to each one.”

    Calls getWorkspaces, then searchItems.

    The agent chooses the workspace, sets the publication window, and sorts by views in descending order. With responseFormat: "concise", each result includes originalUrl and currentEngagement. The example uses a fixed 30-day window; replace its dates and workspace ID for your request.

    tools/call — searchItems
    {
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": {
      "name": "searchItems",
      "arguments": {
        "workspaceId": "6ccefa76-e8ba-5ab0-9c60-e48a9e235a4a",
        "filter": {
          "itemTypes": ["TIKTOK"],
          "takenAt": { "from": "2026-10-01T00:00:00Z", "to": "2026-10-31T00:00:00Z" }
        },
        "sorting": [{ "sortKey": "MERGED_VIEW_PLAY_COUNT", "sortOrder": "DESC" }],
        "responseFormat": "concise",
        "limit": 10
      }
    }
    }

    Creator lookup

    “Who are the creators behind our most viral posts this quarter? Pull their handles and follower counts.”

    Calls searchItems, then searchCreators.

    Match each post’s creator.id to the creator record. Concise searchItems includes this ID. Do not match by handle: a workspace can contain two creator records with the same handle.

    Save a reusable view

    “Create a content view called ‘Q3 UGC winners’ with the same filters as our ‘UGC — all time’ view, and add it to the Campaigns group.”

    Calls getContentViews and getViewGroups, then createContentView and moveContentViewToGroup.

    Copy the source view’s filters, sort, and customAttributeConditions into the new view. Use the new view’s ID and the Campaigns group’s ID to move it into that group. Content View names do not have to be unique, so use IDs to identify the source, destination, and new view. Check userErrors after each write before reporting success. See Agent conventions.

    Import a post

    “Add this Instagram post to Archive and tell me when it’s ready: instagram.com/p/…”

    Calls uploadItemFromUrl, then getOperation.

    uploadItemFromUrl queues an import. Check getOperation for completion before telling the user the post is ready. If the upload times out, verify whether it started before retrying. A repeated upload can start a second import.

    Workflow prompt: weekly content report

    This prompt specifies the reporting window, ranking, comparison, and read-only scope:

    Copy into your connected client
    You are compiling our weekly content report from Archive.
    
    1. Confirm the workspace with me before doing anything else.
    2. Pull the top 15 posts from the last 7 days by engagement,
     using concise responses.
    3. Group them by platform, and for each group note the
     best-performing creator (join on creator id, never on handle).
    4. Compare against the same window last week and call out
     anything that doubled or halved.
    5. Do not create or modify anything — this is a read-only report.
     If a tool call fails, show me the error instead of retrying.