Breeding API endpoint

Table of contents

  1. Fields
  2. List view
  3. Add
  4. Detail
  5. Change
  6. Delete

Fields

FieldDescription
idUUID identificator formatted as a string
namestring [required] [max length: 100]
projectrelated project ID formatted as a string [required]
motherrelated maternal subject ID formatted as a string [required]
fatherrelated paternal subject ID formatted as a string [required]
descriptionstring
tagslist of strings
birth_datedate (YYYY-MM-DD)
start_datedate (YYYY-MM-DD)
end_datedate (YYYY-MM-DD)
weaning_datedate (YYYY-MM-DD)
litter_sizepositive integer
expected_genotypestring [max length: 100]

List view

  • Allowed portals: public, private
  • Request method: GET
  • URL: https://www.brainstem.org/api/private/stem/breeding
  • Data: None
  • Responses: 200 OK; 403 Not allowed; 404 Not found

Use example (using Python API)

resp = client.load('breeding')

Response example

{'breedings': [
        {
            'id': '<id>',
            'name': 'B6J x PV-Cre Spring 2026',
            'project': '<project-id>',
            'mother': '<mother-id>',
            'father': '<father-id>'
        }
    ]
}

Public list responses also include a meta object (pagination/filter metadata).

Add

  • Allowed portals: private
  • Request method: POST
  • URL: https://www.brainstem.org/api/private/stem/breeding
  • Data: JSON dictionary containing at least the required fields.
  • Responses: 201 OK; 400 Bad request; 403 Not allowed; 404 Not found

Additional notes: both mother and father must already belong to the same project as the breeding.

Use example (using Python API)

resp = client.save("breeding", data={
    "name": "NewBreeding",
    "project": "<project-id>",
    "mother": "<mother-id>",
    "father": "<father-id>"
})

Response example

{'breeding': {
    'id': '<id>',
    'name': 'NewBreeding',
    'project': '<project-id>',
    'mother': '<mother-id>',
    'father': '<father-id>'
    }
}

Detail

  • Allowed portals: public, private
  • Request method: GET
  • URL: https://www.brainstem.org/api/private/stem/breeding/<id>/
  • Data: None
  • Responses: 200 OK; 403 Not allowed; 404 Not found

Use example (using Python API)

resp = client.load('breeding', id='<id>')

Response example

{'breeding': {
    'id': '<id>',
    'name': 'NewBreeding',
    'project': '<project-id>',
    'mother': '<mother-id>',
    'father': '<father-id>',
    'description': '',
    'tags': [],
    'birth_date': null,
    'start_date': null,
    'end_date': null,
    'weaning_date': null,
    'litter_size': null,
    'expected_genotype': ''
    }
}

Change

  • Allowed portals: private
  • Request method: PATCH
  • URL: https://www.brainstem.org/api/private/stem/breeding/<id>/
  • Data: dictionary containing the fields to be updated
  • Responses: 200 OK; 400 Bad request; 403 Not allowed; 404 Not found

Use example (using Python API)

resp = client.save("breeding", id="<id>", data={"name": "new name"})

Response example

{'breeding': {
    'id': '<id>',
    'name': 'new name',
    'project': '<project-id>',
    'mother': '<mother-id>',
    'father': '<father-id>'
    }
}

Delete

  • Allowed portals: private
  • Request method: DELETE
  • URL: https://www.brainstem.org/api/private/stem/breeding/<id>/
  • Data: None
  • Responses: 204 OK; 403 Not allowed; 404 Not found

Use example (using Python API)

resp = client.delete("breeding", id="<id>")