Skip to main content

Add a New License Found flag's state(s) to the practitioner's states to credential

POST 

/flags/:id/add-state-to-credential

For a new_credential_found flag on state-licenses, DEA or CDS: appends the flag's single state (always taken from the flag's metaData.state; the request's states must be absent/empty) to statesToCredential. For a compact-license flag (no single state; coverage is metaData.coveredStates, a list): the request's states is required, and must be a non-empty subset of the flag's own coveredStates — a state already on the practitioner is accepted and treated as a no-op, so a retry after a partial success is never rejected — every requested state is added. Either way, states are written to statesToCredential on the practitioner's tenant record (or roster record when only that one carries the list), the flag is marked seen with the note (for an outreachInProgress flag the status is left and the note is recorded on its history), then the state(s) are added to the active monitoring workflow and its flags are recalculated, which closes the flag. Allowed on open, needsVerification, sentToCommittee and outreachInProgress flags. For state-licenses/DEA/CDS, a seen flag answers 409 unless the state is already present, in which case the call only finishes the workflow update (a retry after PARTIAL_SUCCESS) and the note is not recorded. For compact-license, a seen flag never 409s: the flag stays seen and is not re-moved, but any requested state not yet added is still written and the workflow updated — a reviewer can come back and add previously-unselected covered states while the flag is seen. A closed flag always answers 409. Returns 200 with a per-step outcome even when a follow-up step failed: status is FAILED when the practitioner record was not updated, PARTIAL_SUCCESS when it was but the flag or workflow step failed, SUCCESS otherwise. Safe to retry while the flag is not closed: a state already present is not written again and a seen flag is not moved again. Permission checks run before any write. Callers without the needs-verification permission get 404 for needsVerification and internal-only flags, as on GET /flags/{id}/details. Gated by flags.add-state-to-credential.enabled (default true); returns 404 while disabled.

Request​

Responses​

Per-step outcome; inspect status