---
title: "Read a WordPress attachment"
method: GET
path: "/v1/spaces/{spaceId}/content/media/{attachmentId}"
tags: ["Spaces"]
---

# Read a WordPress attachment

`GET /v1/spaces/{spaceId}/content/media/{attachmentId}`

## Request

- Base URL: `https://api.spacefast.com`
- URL: `https://api.spacefast.com/v1/spaces/{spaceId}/content/media/{attachmentId}`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-better-auth.session_token`
  - OAuth 2 (authorization code, authorization URL `https://api.spacefast.com/v1/auth/oauth2/authorize`, token URL `https://api.spacefast.com/v1/auth/oauth2/token`; client credentials, token URL `https://api.spacefast.com/v1/auth/oauth2/token`, scopes: `spaces:read`)

Returns attachment bytes after checking space ownership and WordPress read permissions. The optional size names a WordPress image size. Responses are private and must not be cached.

## Path parameters

- `spaceId` string, required
- `attachmentId` integer, required

## Query parameters

- `size` string

## Response `200`

Attachment bytes

## Other responses

- `default`: Problem details (RFC 9457). Any 4xx/5xx response is one `application/problem+json` document.

---

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