Get resource
Get resource: getResource in the TypeScript, Python, Rust and Go clients.
GET /v1/projects/{id}/platforms/resources/{resourceId}
Reads one resource the project holds. A released number stays readable and reads retired, because it remains part of this project's history. A dedicated line given back does NOT: returning it to inventory is what makes it claimable by someone else, so it answers 404 and the operation that returned it is the record that this project once held it. Requires the platforms:read permission bound to the project resource in the path.
photon.projects.platforms.getResource(input: GetResourceInput, options?: RequestOptions): Promise<GetResourceOutput>photon.projects.platforms.get_resource(input: GetResourceInput, *, options: RequestOptions | None = None) -> models.Resourceclient.get_resource(id: String, resource_id: String).await -> Result<ResponseValue<types::Resource>, Error<GetResourceError>>client.Projects.Platforms.GetResource(ctx context.Context, params *GetResourceParams, opts ...RequestOption) (*Resource, error)import { Photon } from "@photon-ai/api";
const photon = new Photon({
headers: { Authorization: `Bearer ${process.env.PHOTON_API_TOKEN}` },
});
const result = await photon.projects.platforms.getResource({
path: {
id: "id",
resourceId: "resourceId",
},
});import os
from photon_api import Photon
from photon_api.rpc_generated import GetResourceInput
photon = Photon(headers={"Authorization": f"Bearer {os.environ['PHOTON_API_TOKEN']}"})
result = photon.projects.platforms.get_resource(
GetResourceInput.model_validate({
"path": {
"id": "id",
"resourceId": "resourceId",
},
})
)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_resource("id".to_owned(), "resourceId".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.Platforms.GetResource(ctx, &photonapi.GetResourceParams{
ID: "id",
ResourceID: "resourceId",
})
if err != nil {
return err
}
_ = result{
"abilities": [
"string"
],
"createdAt": "2026-01-01T00:00:00.000Z",
"detail": {},
"projectId": "string",
"resourceId": "string",
"retiredAt": "2026-01-01T00:00:00.000Z",
"state": "unallocated",
"type": "string",
"updatedAt": "2026-01-01T00:00:00.000Z"
}Parameters
Selects the API contract date. Without it, the request is served as 2026-07-01.
Returns
200 The resource. Resource
Headers: ETag, Photon-Version. The raw response carries these headers; see Raw responses.
Per-type public detail. Only voip_line includes activationState: activating or active. Every voip_line includes it; without an owner-matched saved record it defaults to active. This includes imported, legacy and unallocated numbers. This is not provider-confirmed readiness; elapsed time alone never changes saved activation. A retired number retains its saved activation state.
304 Not Modified. Sent only when If-None-Match matches the ETag of an earlier 200 response for the same representation; no body. No body.
Headers: ETag, Photon-Version. The raw response carries these headers; see Raw responses.