---
title: "Update a resource"
method: POST
path: "/v1/resources/{id}"
tags: ["Resources"]
---

# Update a resource

`POST /v1/resources/{id}`

## Request

- Base URL: `https://api.affiliaterail.com`
- URL: `https://api.affiliaterail.com/v1/resources/{id}`
- Auth: HTTP bearer

Title, folder, audience scoping and `published`; `url` on links only. Moving folders puts the resource at the end of the new one.

**Scope:** `write`

## Path parameters

- `id` string, required: Prefixed id (`res_…`)

## Request body

- ResourceUpdate
  - `title` string
  - `url` string, uri: Links only; a file's URL is its blob
  - `folder` string, nullable
  - `group_ids` string[]
  - `tag_ids` string[]
  - `published` boolean

## Response `200`

The resource

- Resource
  - `id` string, required: Prefixed id (`res_…`)
  - `object` 'resource', required
  - `program_id` string, required: Prefixed id (`prg_…`)
  - `kind` 'file' | 'link', required
  - `title` string, required
  - `url` string, required
  - `folder` string, nullable, required
  - `mime_type` string, nullable, required
  - `size_bytes` integer, nullable, required
  - `group_ids` string[], required: Empty means every group sees it
  - `tag_ids` string[], required
  - `position` integer, required
  - `published` boolean, required
  - `published_at` string, date-time, nullable, required: ISO-8601, UTC
  - `metadata` object, nullable, required: Your own key/value data, stored as given
  - `created_at` string, date-time, required: ISO-8601, UTC
  - `updated_at` string, date-time, required: ISO-8601, UTC

## Other responses

- `400`: Invalid request
- `401`: Missing or unknown API key
- `403`: Key lacks the required scope
- `404`: No such object in your organization
- `422`: The request was understood and refused
- `429`: Rate limited: see Retry-After

---

[API](https://skmtc.dev/affiliaterail/apis/affiliaterail-api.md) · [All operations](https://skmtc.dev/affiliaterail/apis/affiliaterail-api/llms.txt) · [OpenAPI document](https://skmtc.dev/affiliaterail/apis/affiliaterail-api/revisions/ea41f345c092?raw)
