Skip to content

Lambda API endpoints

James Kent edited this page Oct 17, 2025 · 2 revisions

Compose-Runner API Cheatsheet

1) Invoke a job

Endpoint: https://mg2u6jhimgqnlxaaj6ssgnec6q0pfxrf.lambda-url.us-east-1.on.aws/

Example:

curl -X POST "https://mg2u6jhimgqnlxaaj6ssgnec6q0pfxrf.lambda-url.us-east-1.on.aws/" \
  -H "Content-Type: application/json" \
  -d '{
    "meta_analysis_id": "pFGy6g3LRo9x",
    "environment": "production"
  }'

Sample response:

{
  "job_id": "3e0405ce-ee95-4898-99af-eaa89136cbe2",
  "status": "SUCCEEDED",
  "result_url": "https://compose.neurosynth.org/meta-analyses/pFGy6g3LRo9x",
  "artifacts_bucket": "composerunnerstack-composerunnerresults0fe459c9-wyzha3pbrx0p",
  "artifacts_prefix": "compose-runner/results"
}

2) Fetch logs for a job

Endpoint: https://oniyt5po2iorelr326zszptwcy0xbjzz.lambda-url.us-east-1.on.aws/

Example:

curl -X POST "https://oniyt5po2iorelr326zszptwcy0xbjzz.lambda-url.us-east-1.on.aws/" \
  -H "Content-Type: application/json" \
  -d '{
    "job_id": "3e0405ce-ee95-4898-99af-eaa89136cbe2"
  }'

Sample response (truncated):

{
  "job_id": "3e0405ce-ee95-4898-99af-eaa89136cbe2",
  "events": [
    {
      "timestamp": 1760662984452,
      "message": "START RequestId: 3e0405ce-ee95-4898-99af-eaa89136cbe2 Version: $LATEST\n"
    },
    {
      "timestamp": 1760662984463,
      "message": "[INFO]\t2025-10-17T01:03:04.463Z\t3e0405ce-ee95-4898-99af-eaa89136cbe2\t{\"job_id\": \"3e0405ce-ee95-4898-99af-eaa89136cbe2\", \"message\": \"workflow.start\", \"meta_analysis_id\": \"pFGy6g3LRo9x\", \"environment\": \"production\", \"no_upload\": false}\n"
    },
    {
      "timestamp": 1760663001299,
      "message": "[INFO]\t2025-10-17T01:03:21.299Z\t3e0405ce-ee95-4898-99af-eaa89136cbe2\t{\"job_id\": \"3e0405ce-ee95-4898-99af-eaa89136cbe2\", \"message\": \"workflow.completed\", \"result_url\": \"https://compose.neurosynth.org/meta-analyses/pFGy6g3LRo9x\"}\n"
    }
  ],
  "next_token": "Bxkq6kVGFtq2y_MoigeqscPOdhXVbhiVtLoA..."
}

Use next_token for pagination to fetch additional log events.


3) List/download job artifacts

Endpoint: https://23llzhs3nz6o4e47ycofhluqqa0zjyko.lambda-url.us-east-1.on.aws/

Example:

curl -X POST "https://23llzhs3nz6o4e47ycofhluqqa0zjyko.lambda-url.us-east-1.on.aws/" \
  -H "Content-Type: application/json" \
  -d '{
    "job_id": "421c01e3-074a-4670-ac1d-3b67a28645e6",
    "expires_in": 900
  }'

Sample response (abbrev.):

{
  "job_id": "421c01e3-074a-4670-ac1d-3b67a28645e6",
  "artifacts": [
    {
      "key": "compose-runner/results/.../boilerplate.txt",
      "filename": "boilerplate.txt",
      "size": 738,
      "last_modified": "2025-10-17T00:07:16+00:00",
      "url": "https://composerunnerstack-.../boilerplate.txt?...&Expires=1760664273"
    },
    {
      "key": "compose-runner/results/.../meta_results.pkl",
      "filename": "meta_results.pkl",
      "size": 26491824,
      "last_modified": "2025-10-17T00:07:15+00:00",
      "url": "https://composerunnerstack-.../meta_results.pkl?...&Expires=1760664273"
    }
    // more files...
  ],
  "bucket": "composerunnerstack-composerunnerresults0fe459c9-wyzha3pbrx0p",
  "prefix": "compose-runner/results/421c01e3-074a-4670-ac1d-3b67a28645e6"
}

Quick reference

  • meta_analysis_id: ID of the meta-analysis to run.
  • environment: Deployment target (e.g., production).
  • job_id: Returned by the invoke API; use it to query logs and results.
  • result_url: Human-readable results page.
  • artifacts_*: S3 bucket/prefix where outputs are stored.
  • expires_in: Seconds for pre-signed artifact URLs to remain valid.

Tip: Save the job_id from step 1; you’ll need it for logs (step 2) and artifacts (step 3).

Clone this wiki locally