> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api.docs.siftsy.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.docs.siftsy.com/_mcp/server.

# Archive posts already on the team

POST https://api.siftsy.app/analyst/v1/content/posts/archive
Content-Type: application/json

Requires `posts:write`. Archives up to 100 posts that are already on
the team, by `postIds` and/or `links`, the same as Archive in the
dashboard. Archived posts drop out of `GET /posts` unless you pass
`status=archived` or `status=all`. Nothing is deleted. Responds `200`
immediately and does not spend credits.

A post that is already archived is `rejected` with `already_archived`.
A link that is not on the target team is `not_on_team`; an unknown post
id, or one on another team, is `not_found`. `teamId` targets an
Enterprise sub-team as on the other content routes.

Rate class `content_post_archive` (20 / minute, 500 / day per key,
shared with `/content/posts/unarchive`).


Reference: https://api.docs.siftsy.com/api-reference/siftsy-analyst-api/archive-posts

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.
- `X-Api-Key` header (required) — API Key authentication via header

## Servers

- `https://api.siftsy.app/analyst/v1` (Production, default)
- `http://localhost:3000/analyst/v1` (Local development)

## Request

### Body (application/json)

This endpoint expects an ArchivePostsRequest.

- `postIds` (list of string, optional) — Post ids on the target team (from `GET /posts`)
- `links` (list of string, optional) — Post URLs already on the target team. A link that is not on the team is rejected.
- `teamId` (string, optional) — Enterprise keys only — a sub-team of the key's enterprise

## Response

### 200

Archive applied. Per-post rows say what changed and what was rejected.

- `data` (EnvelopePostArchiveData, optional)
- `meta` (EnvelopePostArchiveMeta, optional)

## Errors

### 400 Bad Request Error

Invalid request

- `any`

### 403 Forbidden Error

Missing required scope

- `any`

### 404 Not Found Error

Resource not found

- `any`

### 429 Too Many Requests Error

A per-minute cap, a per-day budget, or the daily transfer cap was exceeded. `error.message` is `Rate limit exceeded`, `Daily request limit exceeded`, or `Daily transfer limit exceeded`. Honor `Retry-After` (next UTC minute for burst caps; UTC midnight for daily budgets). Sized for a scheduled BI refresh: burst caps that a sequential loop cannot trip, daily budgets that fit eight full refreshes a day of a 500-post workspace or one full refresh plus hourly incrementals. Defaults: 300/minute and 10,000/day globally, with class budgets for per-post comment samples (120/min, 1,000/day), analysis-wide comment samples (20/min, 300/day), collection posts (60/min, 1,000/day), analysis reads (60/min, 2,000/day), analysis create (10/min, 100/day), AI search and written answers (2/min, 10/day), scans, breakdowns, and link matching (20/min, 500/day each), analysis exports (30/min, 500/day), adding posts (10/min, 200/day), adding accounts (2/min, 20/day), refreshing posts (10/min, 200/day), tagging and archiving posts (20/min, 500/day each), share links (10/min, 200/day), and content job polls (60/min, 2,000/day). Daily transfer cap 500 MB. `POST /analyses` with AI also returns `429` with `error.code: ai_budget_exceeded` when the team's daily AI budget is spent; `error.budget` has `used`, `limit`, and `resetsAt`, and `Retry-After` runs to UTC midnight.

- `any`

## Types

### EnvelopePostArchiveData

- `operation` (enum, optional)
  - Allowed values: `archive`, `unarchive`
- `teamId` (string, optional)
- `counts` (EnvelopePostArchiveDataCounts, optional)
- `updated` (list of PostArchiveResult, optional)
- `rejected` (list of PostArchiveResult, optional)
- `failed` (list of PostArchiveResult, optional)

### EnvelopePostArchiveMeta

### EnvelopePostArchiveDataCounts

- `requested` (integer, optional)
- `updated` (integer, optional)
- `rejected` (integer, optional)
- `failed` (integer, optional)

### PostArchiveResult

- `postId` (string, optional, nullable)
- `link` (string, optional, nullable)
- `status` (enum, optional) — The post's status after the update (`updated` rows only)
  - Allowed values: `archived`, `complete`
- `reason` (string, optional, nullable) — `not_on_team`, `not_found`, `duplicate_in_batch`, `unsupported_platform`, `invalid_url`, `already_archived`, `not_archived`, or `update_failed`

## Examples

**Request**

```json
{
  "postIds": [
    "post_01j9z"
  ],
  "links": [
    "https://www.tiktok.com/@dove/video/7412345678901234567"
  ]
}
```

**Response**

```json
{
  "data": {
    "operation": "archive",
    "teamId": "team_2f8c1a",
    "counts": {
      "requested": 2,
      "updated": 1,
      "rejected": 1,
      "failed": 0
    },
    "updated": [
      {
        "postId": "post_01j9y",
        "link": "https://www.tiktok.com/@dove/video/7412345678901234567",
        "status": "archived"
      }
    ],
    "rejected": [
      {
        "postId": "post_01j9z",
        "link": "https://www.instagram.com/reel/C9AbCdEfGhI/",
        "reason": "already_archived"
      }
    ],
    "failed": []
  },
  "meta": {}
}
```

**SDK Code**

```python content_archivePosts_example
import requests

url = "https://api.siftsy.app/analyst/v1/content/posts/archive"

payload = {
    "postIds": ["post_01j9z"],
    "links": ["https://www.tiktok.com/@dove/video/7412345678901234567"]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript content_archivePosts_example
const url = 'https://api.siftsy.app/analyst/v1/content/posts/archive';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"postIds":["post_01j9z"],"links":["https://www.tiktok.com/@dove/video/7412345678901234567"]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go content_archivePosts_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.siftsy.app/analyst/v1/content/posts/archive"

	payload := strings.NewReader("{\n  \"postIds\": [\n    \"post_01j9z\"\n  ],\n  \"links\": [\n    \"https://www.tiktok.com/@dove/video/7412345678901234567\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby content_archivePosts_example
require 'uri'
require 'net/http'

url = URI("https://api.siftsy.app/analyst/v1/content/posts/archive")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"postIds\": [\n    \"post_01j9z\"\n  ],\n  \"links\": [\n    \"https://www.tiktok.com/@dove/video/7412345678901234567\"\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java content_archivePosts_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.siftsy.app/analyst/v1/content/posts/archive")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"postIds\": [\n    \"post_01j9z\"\n  ],\n  \"links\": [\n    \"https://www.tiktok.com/@dove/video/7412345678901234567\"\n  ]\n}")
  .asString();
```

```php content_archivePosts_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.siftsy.app/analyst/v1/content/posts/archive', [
  'body' => '{
  "postIds": [
    "post_01j9z"
  ],
  "links": [
    "https://www.tiktok.com/@dove/video/7412345678901234567"
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp content_archivePosts_example
using RestSharp;

var client = new RestClient("https://api.siftsy.app/analyst/v1/content/posts/archive");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"postIds\": [\n    \"post_01j9z\"\n  ],\n  \"links\": [\n    \"https://www.tiktok.com/@dove/video/7412345678901234567\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift content_archivePosts_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "postIds": ["post_01j9z"],
  "links": ["https://www.tiktok.com/@dove/video/7412345678901234567"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.siftsy.app/analyst/v1/content/posts/archive")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```