Skip to content

Registering programs

Before any program can be ingested into CanDIG, it needs to be registered. To first register a program, you must be either a site admin or a site curator. During program registration, you can also assign program curators and team members to the program. For more information about user roles in CanDIG, see User roles in CanDIG. If you need to be made a site curator or program curator, please contact your local site administrator to assign your user profile the appropriate role.

  1. Get a token by logging into the CanDIG data portal as site admin or site curator and copying the API token.

    a. Go to the icon in the top right of the screen and click the cog

    b. Click ‘ *** Get API Token’

    c. Click the token to copy the text

  2. Open a terminal and save it into a variable called TOKEN

Terminal window
TOKEN=ey-pasted-jwt
  1. POST to the program endpoint in ingest to assign a user the program curator role for a specific program, e.g. program SYNTH_03 with user2@test.ca
Terminal window
curl -s --request POST \
--url $CANDIG_URL'/ingest/program' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer '$TOKEN \
-d '{"program_id": "local-SYNTH_03", "program_curators": ["user2@local-test.ca"], "team_members": []}'

As an example, if you had previously submitted the program registration above, and you then want to ADD user1@local-test.ca as a team member to the program local-SYNTH_03, you would first GET the current registration with this curl call:

Terminal window
curl -s --request GET \
--url $CANDIG_URL'/ingest/program/local-SYNTH_03' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer '$TOKEN

Your response would be:

Terminal window
{
"date_created": "2025-11-04",
"program_curators": [
"user2@local-test.ca"
],
"program_id": "local-SYNTH_03",
"team_members": []
}

You would then copy and modify the program registration and POST the updated registration:

Terminal window
curl -s --request POST \
--url $CANDIG_URL'/ingest/program' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer '$TOKEN \
-d '{"program_id": "local-SYNTH_03", "program_curators": ["user2@local-test.ca"], "team_members": ["user1@local-test.ca"]}'

And you should get the response with user2 as a program curator and user1 as a team member:

Terminal window
{
"local-SYNTH_03": {
"date_created": "2025-11-04",
"program_curators": [
"user2@local-test.ca"
],
"program_id": "local-SYNTH_03",
"team_members": [
"user1@local-test.ca"
]
},
"warnings": [
"Default site administrator site_admin@local-test.ca is still configured. Use the /ingest/site-role/site_admin endpoint to set a different site admin."
]
}