Count a line's filtered verification codes
Count a line's filtered verification codes: countResourceFilteredVerificationCodes in the TypeScript, Python, Rust and Go clients.
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>photon.projects.platforms.count_resource_filtered_verification_codes(input: CountResourceFilteredVerificationCodesInput, *, options: RequestOptions | None = None,) -> models.FilteredVerificationCodeCountclient.count_resource_filtered_verification_codes(id: String, resource_id: String, params: Option<CountResourceFilteredVerificationCodesParams>).await -> Result<ResponseValue<types::FilteredVerificationCodeCount>, Error<CountResourceFilteredVerificationCodesError>>client.Projects.Platforms.CountResourceFilteredVerificationCodes(ctx context.Context, params *CountResourceFilteredVerificationCodesParams, opts ...RequestOption) (*FilteredVerificationCodeCount, 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.countResourceFilteredVerificationCodes({
path: {
id: "id",
resourceId: "resourceId",
},
});import os
from photon_api import Photon
from photon_api.rpc_generated import CountResourceFilteredVerificationCodesInput
photon = Photon(headers={"Authorization": f"Bearer {os.environ['PHOTON_API_TOKEN']}"})
result = photon.projects.platforms.count_resource_filtered_verification_codes(
CountResourceFilteredVerificationCodesInput.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
.count_resource_filtered_verification_codes("id".to_owned(), "resourceId".to_owned(), None)
.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.CountResourceFilteredVerificationCodes(ctx, &photonapi.CountResourceFilteredVerificationCodesParams{
ID: "id",
ResourceID: "resourceId",
})
if err != nil {
return err
}
_ = result{
"count": 0,
"receivedAfter": "2026-09-02T00:00:00.000Z",
"receivedBefore": "2026-10-02T00:00:00.000Z"
}Parameters
Selects the API contract date. Without it, the request is served as 2026-07-01.
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.
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.