Skip to content

GET /v1/projects/{id}/platforms/resources/{resourceId}/filtered-otp/count

Counts the verification codes Photon kept from one dedicated line. Without receivedAfter and receivedBefore the window is the 30 days before the request; a window longer than 366 days is rejected. The response echoes the window it resolved, so the number always says which period it covers. Answers 404 unless the project holds the resource now. Codes from an earlier tenure stay in the project-wide list. Filter by platform — a dedicated line receives both iMessage and WhatsApp. Requires the platforms:read permission bound to the project resource in the path.

photon.projects.platforms.countResourceFilteredVerificationCodes(input: CountResourceFilteredVerificationCodesInput, options?: RequestOptions): Promise<CountResourceFilteredVerificationCodesOutput>
import { Photon } from "@photon-ai/api";

const photon = new Photon({
  headers: { Authorization: `Bearer ${process.env.PHOTON_API_TOKEN}` },
});
const result = await photon.projects.platforms.countResourceFilteredVerificationCodes({
  path: {
    id: "id",
    resourceId: "resourceId",
  },
});
{
  "count": 0,
  "receivedAfter": "2026-09-02T00:00:00.000Z",
  "receivedBefore": "2026-10-02T00:00:00.000Z"
}

Parameters

Photon-VersionPhotonVersion

Selects the API contract date. Without it, the request is served as 2026-07-01.

idstringrequired
resourceIdstringrequired
platformFilteredVerificationCodePlatform
receivedAfterstring (date-time)
receivedBeforestring (date-time)

Returns

200 How many codes were filtered in the resolved window. FilteredVerificationCodeCount

Headers: ETag, Photon-Version. The raw response carries these headers; see Raw responses.

countintegerrequired
receivedAfterstring (date-time)required
receivedBeforestring (date-time)required

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.