Callback

Send notifications to GitHub or Slack

sfp server callback post

Post a callback notification to configured providers (GitHub, Slack, etc.).

USAGE
  $ sfp server callback post -e started|completed|failed|approval_requested|approved|rejected -p <value> [--json]
    [--repository <value>] [-e <value>] [-t <value>] [--sfp-server-url <value>] [--loglevel
    trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] [-x <value> | --context-id <value>] [--close]

FLAGS
  -e, --email=<value>              Email address for authenticated user. Ignored if --application-token is provided. Can
                                   be set via SFP_SERVER_USER env var.
  -e, --event=<option>             (required) The event type: started, completed, or failed
                                   <options: started|completed|failed|approval_requested|approved|rejected>
  -p, --provider=<value>           (required) JSON configuration for the callback provider
  -t, --application-token=<value>  Application token for CI/CD authentication. Can be set via SFP_SERVER_TOKEN env var
                                   (CLI flags take precedence over env vars).
  -x, --context=<value>            JSON context data for the callback message
      --close                      Close the callback target (e.g., close GitHub issue) after posting
      --context-id=<value>         ID of callback context stored on the server (requires an application token)
      --loglevel=<option>          [default: info] logging level for this command invocation
                                   <options: trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL>
      --repository=<value>         The repository identifier. E.g `owner/repo` for GitHub/GitLab or `org/project/repo`
                                   for Azure DevOps
      --sfp-server-url=<value>     URL of the SFP server. Can be set via SFP_SERVER_URL env var or config: sfp
                                   config:set server-url

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Post a callback notification to configured providers (GitHub, Slack, etc.).

  This command is typically called from automated workflows to notify users of task status changes.

  Supply exactly one of `--context` (inline JSON) or `--context-id` (a stored context UUID).
  Workflows save the context with `POST /sfp/api/callbacks/contexts`, passing `{ "context": { "message": "..." } }`,
  then pass the returned ID. The CLI fetches it using the server URL and application token before posting.
  Stored contexts are account-scoped and expire after 24 hours; the workflow deletes them after the command finishes.

EXAMPLES
  `sfp server callback post --event started --provider '{"type":"github","github":{"repo":"owner/repo","issue":123}}' --context '{"username":"user@example.com","accessLevel":"admin"}'`

  `sfp server callback post --event completed --provider '{"type":"github","github":{"repo":"owner/repo","issue":123}}' --context '{"username":"user@example.com"}' --close`

  `sfp server callback post --event approval_requested --provider '{"type":"github","repositoryIdentifier":"owner/repo","issueNumber":123}' --context-id 3ff535b0-e12d-4d7e-b3d0-93b324008d20 --sfp-server-url https://codev.example.com --application-token <token>`

On this page