Unassign SMS line campaign
Unassign SMS line campaign: unassignSmsLineCampaign in the TypeScript, Python, Rust and Go clients.
DELETE /v1/projects/{id}/platforms/sms/lines/{resourceId}/campaign
Any project writer, including a scoped API key, may detach the campaign. The number and campaign remain owned. Requires a permanent Idempotency-Key and expectedVersion. Local eligibility is blocked immediately; provider detachment runs asynchronously. If the operation fails, its error is the problem of one of these codes: SMS_CAMPAIGN_PROVIDER_REJECTED, SMS_CAMPAIGN_RECONCILIATION_REQUIRED, SMS_CAMPAIGN_REVOKED.
photon.projects.platforms.unassignSmsLineCampaign(input: UnassignSmsLineCampaignInput, options?: RequestOptions): Promise<UnassignSmsLineCampaignOutput>photon.projects.platforms.unassign_sms_line_campaign(input: UnassignSmsLineCampaignInput, *, options: RequestOptions | None = None) -> models.Operationclient.unassign_sms_line_campaign(idempotency_key: String, id: String, resource_id: String, expected_version: f64).await -> Result<ResponseValue<UnassignSmsLineCampaignResponse>, Error<UnassignSmsLineCampaignError>>client.Projects.Platforms.UnassignSmsLineCampaign(ctx context.Context, params *UnassignSmsLineCampaignParams, opts ...RequestOption) (*Operation, 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.unassignSmsLineCampaign({
path: {
id: "id",
resourceId: "resourceId",
},
query: {
expectedVersion: 1,
},
headers: {
idempotencyKey: "idempotencyKey",
},
});import os
from photon_api import Photon
from photon_api.rpc_generated import UnassignSmsLineCampaignInput
photon = Photon(headers={"Authorization": f"Bearer {os.environ['PHOTON_API_TOKEN']}"})
result = photon.projects.platforms.unassign_sms_line_campaign(
UnassignSmsLineCampaignInput.model_validate({
"path": {
"id": "id",
"resourceId": "resourceId",
},
"query": {
"expectedVersion": 1,
},
"headers": {
"Idempotency-Key": "idempotencyKey",
},
})
)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
.unassign_sms_line_campaign(
"idempotencyKey".to_owned(),
"id".to_owned(),
"resourceId".to_owned(),
1.0,
)
.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.UnassignSmsLineCampaign(ctx, &photonapi.UnassignSmsLineCampaignParams{
IdempotencyKey: "idempotencyKey",
ID: "id",
ResourceID: "resourceId",
ExpectedVersion: 1,
})
if err != nil {
return err
}
_ = result{
"cancellable": true,
"createdAt": "2026-01-01T00:00:00.000Z",
"detail": {},
"endedAt": "2026-01-01T00:00:00.000Z",
"error": {
"code": "CHARGE_REFUSED",
"remediation": {
"action": "Check the payment method in Billing, then request the purchase again."
},
"status": 402,
"title": "Charge Refused",
"type": "https://photon.codes/docs/problems/charge-refused"
},
"operationId": "string",
"projectId": "string",
"reason": "charge_refused",
"resourceId": "string",
"resourceType": "string",
"startedAt": "2026-01-01T00:00:00.000Z",
"state": "pending",
"type": "resource.provision",
"updatedAt": "2026-01-01T00:00:00.000Z"
}{
"cancellable": true,
"createdAt": "2026-01-01T00:00:00.000Z",
"detail": {},
"endedAt": "2026-01-01T00:00:00.000Z",
"error": {
"code": "CHARGE_REFUSED",
"remediation": {
"action": "Check the payment method in Billing, then request the purchase again."
},
"status": 402,
"title": "Charge Refused",
"type": "https://photon.codes/docs/problems/charge-refused"
},
"operationId": "string",
"projectId": "string",
"reason": "charge_refused",
"resourceId": "string",
"resourceType": "string",
"startedAt": "2026-01-01T00:00:00.000Z",
"state": "pending",
"type": "resource.provision",
"updatedAt": "2026-01-01T00:00:00.000Z"
}Parameters
Selects the API contract date. Without it, the request is served as 2026-07-01.
Identifies one logical mutation across retries.
Returns
200 The original terminal operation on an authorized replay. No Retry-After is emitted. Operation
Headers: Cache-Control, Location, Photon-Version. The raw response carries these headers; see Raw responses.
Why the operation failed: the problem of its code, the same object the endpoint returns when it rejects a request, with the status that rejection would have had (the poll itself answers 200). Every code an operation can end with is a branch below, and the endpoint that starts the operation lists its codes. Branch on code, never on status, and keep a default: a code added after your client was generated arrives as a generic problem with type: about:blank and status: 500. That 500 means this document does not describe the code yet, not that the request failed on our side or that retrying will help.
202 Assignment accepted. Poll the operation Location until terminal. Operation
Headers: Cache-Control, Location, Photon-Version. The raw response carries these headers; see Raw responses.
Why the operation failed: the problem of its code, the same object the endpoint returns when it rejects a request, with the status that rejection would have had (the poll itself answers 200). Every code an operation can end with is a branch below, and the endpoint that starts the operation lists its codes. Branch on code, never on status, and keep a default: a code added after your client was generated arrives as a generic problem with type: about:blank and status: 500. That 500 means this document does not describe the code yet, not that the request failed on our side or that retrying will help.