Get attachment
Get attachment: getAttachment in the TypeScript, Python, Rust and Go clients.
GET /v1/projects/{id}/attachments/{attachmentId}
Returns an Attachment's metadata. Use the content endpoint to download its bytes. If its metadata is unavailable after ten seconds, returns ATTACHMENT_NOT_READY with Retry-After: 5.
photon.projects.getAttachment(input: GetAttachmentInput, options?: RequestOptions): Promise<GetAttachmentOutput>photon.projects.get_attachment(input: GetAttachmentInput, *, options: RequestOptions | None = None) -> models.Attachmentclient.get_attachment(attachment_id: String, id: String).await -> Result<ResponseValue<types::Attachment>, Error<GetAttachmentError>>client.Projects.GetAttachment(ctx context.Context, params *GetAttachmentParams, opts ...RequestOption) (*Attachment, error)import { Photon } from "@photon-ai/api";
const photon = new Photon({
headers: { Authorization: `Bearer ${process.env.PHOTON_API_TOKEN}` },
});
const result = await photon.projects.getAttachment({
path: {
attachmentId: "attachmentId",
id: "id",
},
});import os
from photon_api import Photon
from photon_api.rpc_generated import GetAttachmentInput
photon = Photon(headers={"Authorization": f"Bearer {os.environ['PHOTON_API_TOKEN']}"})
result = photon.projects.get_attachment(
GetAttachmentInput.model_validate({
"path": {
"attachmentId": "attachmentId",
"id": "id",
},
})
)use photon_ai_api::{Credential, PhotonClientBuilder, SecretString};
let token = std::env::var("PHOTON_API_TOKEN")?;
let client = PhotonClientBuilder::new()
.credential("accountServiceKey", Credential::Bearer(SecretString::from(token)))
.build()?;
let result = client
.get_attachment("attachmentId".to_owned(), "id".to_owned())
.await
.map_err(|error| format!("{error:?}"))?
.into_inner();import (
"context"
"os"
photonapi "github.com/photon-hq/api/packages/go"
)
ctx := context.Background()
client := photonapi.NewClient(photonapi.WithAPIKey(os.Getenv("PHOTON_API_TOKEN")))
result, err := client.Projects.GetAttachment(ctx, &photonapi.GetAttachmentParams{
AttachmentID: "attachmentId",
ID: "id",
})
if err != nil {
return err
}
_ = result{
"contentType": "string",
"createdAt": "2026-01-01T00:00:00Z",
"filename": "string",
"id": "string",
"metadata": {},
"projectId": "string",
"sizeBytes": 1,
"updatedAt": "2026-01-01T00:00:00Z"
}Parameters
Returns
200 The Attachment resource. Attachment