Submitting to the ClinGen LDH
Content can be submitted for ingestion in the LDH via the multi-tenant, access-controlled Message Queue Bridge REST API (Bridge API) by sending a PUT request containing a content-submission message in the body of the request. Upon receipt, the submitted content is put into a submission queue for validation and processing. If the submission contains variants that have not been registered with the ClinGen Allele Registry, an attempt to register them will be made. Valid submissions will then be sent to an ingest message queue where they will be ingested into the LDH in the order they were processed.
LDH Content Submission Requests
Data is submitted by sending an HTTP PUT request to the specified Bridge API endpoint. For these requests the following requirements must be met:
- Content-Type
- Must reflect the payload type, ie 'application/json.'
- Authorization
- Must have a valid jwt bearer token in the Authorization header
- User must have the correct permissions for each endpoint
- Submission
- The request body must be a json object. If the request is a batch request, it may be an array of valid json objects. See Content Submission Body below for more detail.
- IMPORTANT If the request is a batch request, each object in the array will be processed as a separate submitted message
Content Submission Body
The request body must be a json object in the following standard event-message format or an array of valid event-messages. One event-message may contain multiple linked data (ld) records of the same type for a single LDH subject (ie a Variant or Gene). Each subject requires a new event-message. The event-message contains two required top-level fields event and content. The event field contains information about the 'event' that caused the message and relevant event context such as who submitted the message and when. The content field contains the actual content being submitted. For LDH content submission or update messages the content field has two specific top-level fields: sbj and ld. These represent the LDH subject, ie the Gene or Variant, for which content is being submitted as linked data, and the linked data being submitted.
Details
| Field | Description | Example |
event | Info about the "event" causing the message and event context | See Event Subfields table below for more information |
content | Actual message info. For LDH content submissions, content has specific top-level fields: sbj and ld | See Content Subfields table below for more information |
| Event Subfields | ||
| Field | Description | Example |
type | The type or category of the event. Should be kebab-case. Required | 'cg-ldh-ld-submission' |
name | The event name. Corresponds to the entity type for LDH content submission or update messages. Required | 'MaveDbMapping' |
uuid | Unique message id, typically a UUID v4. Required | '8beeec05-1054-4d83-81c2-c4be4ec64ccb' |
sbj | Object containing info about the event subject, i.e. what is the event 'about' or in the case of LDH content submissions, what gene or variant is the submitted content 'about'? For LDH content submission or update messages, this will be redundant with info found in the content.sbj field. | json5 |
sbj.id | Subject contextual identifier. For LDH content submissions will be either a variant identifier in the form of an hgvs, allele registry ID or clinVar ID or a gene symbol. Required | 'NC_000002.12:g.169082904A>T' |
sbj.type | Entity type of the subject for which linked data is being submitted. For LDH content submissions will be either 'Variant' or 'Gene'. Required | 'Variant' |
sbj.format | Format of the sbj.id value. Will be one of the following values: 'hgvs', 'alleleRegistryID', 'clinvarID', or 'geneSymbol'. Required | 'hgvs' |
sbj.iri | Subject IRI if available, else null. Required | null |
sbj.add | Should the subject of the message be added to the LDH if it is not already present in the LDH. Typically, this should be 'true'. If true and the LD subject is already in the LDH, no changes will be made. However, if the subject of the submitted LD is not already in the LDH, it will be added. If false and the LD subject is not in the LDH, the subject will not be added AND depending on the entity type of the LD being submitted, the LD will either be ingested as 'orphan' docs that are not linked to any gene or variant or not ingested. | 'true' |
triggered | Object containing info about what triggered the event, i.e. 'Who? Where? When? and By What?' | json5 |
triggered.by | Object containing information about the submitter. | json5 |
triggered.by.host | The submitter host. Can be the domain where data is hosted, source of code for submission pipeline used to submit content, or other identifying values. | 'https://github.com/test/' |
triggered.by.id | Name or ID of the service or process responsible for submission. | 'submission_pipeline' |
triggered.by.iri | The IRI for the service/site/code/data host issuing the content submission. | 'https://github.com/test/submission_pipeline' |
triggered.at | The ISO date of message creation/submission | '2022-02-07T18:06:37.963Z' |
| Content Subfields | ||
| Field | Description | Example |
sbj | Object whose only key is the LDH entity type of the message subject. For ClinGen LDH content submissions the possible key values are 'Variant' or 'Gene'. The value for this field must be an object supplying a contextual identifier in the format specified by the event.sbj.format field. Alternatively, for variants, an hgvs value may be supplied. | json5 |
ld | Object where the keys must be the LDH entity type of the data being submitted and the value for each key must be an array of one or more LD records. Note: When more than one LD record is submitted in one message, duplicate records in the same array will result in rejection of all or part of the submitted records. | json5 |
Example
{
"event": {
"type": "cg-ldh-ld-submission",
"name": "testEntity",
"uuid": "f5219414-d52d-4a9f-b15f-e9cbdc49d1a3",
"sbj": {
"id": "NC_000002.12:g.169082904A>T",
"iri": null,
"type": 'Variant',
"format": 'hgvs',
"add": true
},
"triggered": {
"by": {
"host": "https://github.com/test/",
"id": "submission_pipeline",
"iri": "https://github.com/test/submission_pipeline"
},
"at": "2024-06-05T23:38:03.878Z"
}
},
"content": {
"sbj": {
"Variant": {
"id": "NC_000002.12:g.169082904A>T"
}
},
"ld": {
"annotation": [
// Array of record objects
]
}
}
}Content Submission Responses
Successful submissions requests will result in a 200 response and will contain the resulting message IDs for each content submission message. Several error responses exists and are indicated by a 4xx or 5xx response code. The most common error responses are:
400Bad Request: This indicates an issue with the request. It could be an issue with the endpoint, the request body, etc. More information will be provided in the response.403Forbidden: This indicates missing, expired, or malformed JWT or insufficient user permissions for the endpoint attempted. See Access Requirements for more information.429Too Many Requests: This indicates the rate limit has been exceeded. See the Rate Limit section for more information.
Success and Common Error Response Examples
{
"data": {
"msg": "Data sent successfully",
"msgIds": [
"(124651,0,-1,0)"
]
},
"metadata": {
"rendered": {
"by": "https://genboree.org/mq/brdg/srvc",
"when": "2025-02-11T23:48:58.001Z"
}
},
"status": {
"code": 200,
"name": "OK"
}
}{
"metadata": {
"rendered": {
"when": "2025-02-11T23:48:58.001Z"
}
},
"status": {
"code": 429,
"name": "Too Many Requests"
}
}{
"metadata": {
"rendered": {
"when": "2025-02-17T21:48:39.525Z"
}
},
"status": {
"code": 403,
"msg": "Insufficient Permission - Request not permitted due to access control rules.",
"name": "Forbidden"
}
}{
"errCode": 400,
"errMsg": "INVALID URL - Your request is invalid. Specifically, the URL path you provided ('/bridge/pulsar/dev-Clingen/LDH/Variant-updatess') is not valid for HTTP 'PUT' requests to the Bridge-API service.",
"errName": "Bad Request",
"errCat": "INVALID URL"
}{
"metadata": {
"rendered": {
"when": "2025-02-17T22:08:35.677Z"
}
},
"status": {
"code": 400,
"msg": "Put Failed - Error! Empty Payload.",
"name": "Bad Request"
}
}Where to Submit
Submission endpoints typically adhere to the following pattern. "https://genboree.org/mq/brdg/pulsar/{tenant}/ldh/submissions/{entType}"
- Example Submission Endpoints
Example Requests and Responses
Examples Showing Submission of a Single Message
export JWT="Your JWT from the Genboree Auth Service"
export URL="https://genboree.org/mq/brdg/pulsar/test"
curl --location --request PUT $URL \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${JWT}" \
--data '{
"event": {
"type": "cg-ldh-ld-submission",
"name": "testEntity",
"uuid": "f5219414-d52d-4a9f-b15f-e9cbdc49d1a3",
"sbj": {
"id": "test",
"iri": "test"
},
"triggered": {
"by": {
"host": "https://github.com/test/",
"id": "submission_pipeline",
"iri": "https://github.com/test/submission_pipeline"
},
"at": "2024-06-05T23:38:03.878Z"
}
},
"content": {
"sbj": {
"Variant": {
"id": "test"
}
},
"ld": {
"test": [
{
"keyVal": "test"
}
]
}
}
}'
# RESPONSE
#{
# "data": {
# "msg": "Data sent successfully",
# "msgIds": [
# "(124651,0,-1,0)"
# ]
# },
# "metadata": {
# "rendered": {
# "by": "https://genboree.org/mq/brdg/srvc",
# "when": "2025-02-11T23:48:58.001Z"
# }
# },
# "status": {
# "code": 200,
# "name": "OK"
# }
#}const fetch = require("node-fetch");
const url = `https://genboree.org/mq/brdg/pulsar/test`;
const jwt="**Your JWT from the Genboree Auth Service**"
const body = {
"event": {
"type": "cg-ldh-ld-submission",
"name": "testEntity",
"uuid": "f5219414-d52d-4a9f-b15f-e9cbdc49d1a3",
"sbj": {
"id": "test",
"iri": "test"
},
"triggered": {
"by": { // these fields should identify the submitter in some way. Hypothetical examples are shown below.
"host": "https://github.com/test/",
"id": "submission_pipeline",
"iri": "https://github.com/test/submission_pipeline"
},
"at": "2024-06-05T23:38:03.878Z"
}
},
"content": {
"sbj": {
"Variant": {
"id": "test"
}
},
"ld": {
"test": [
{
"keyVal": "test"
}
]
}
}
}
const reqConfig = {
method: "PUT",
body: JSON.stringify(body),
headers: {
Authorization: `Bearer ${jwt}`
}
};
const response = await fetch(url, reqConfig);
await response.json()
`
{
"data": {
"msg": "Data sent successfully",
"msgIds": [
"(124651,0,-1,0)"
]
},
"metadata": {
"rendered": {
"by": "https://genboree.org/mq/brdg/srvc",
"when": "2025-02-11T23:48:58.001Z"
}
},
"status": {
"code": 200,
"name": "OK"
}
}
`import requests
url = "https://genboree.org/mq/brdg/pulsar/test"
payload = {
"event": {
"type": "cg-ldh-ld-submission",
"name": "testEntity",
"uuid": "f5219414-d52d-4a9f-b15f-e9cbdc49d1a3",
"sbj": {
"id": "test",
"iri": "test"
},
"triggered": {
"by": {
"host": "https://github.com/test/",
"id": "submission_pipeline",
"iri": "https://github.com/test/submission_pipeline"
},
"at": "2024-06-05T23:38:03.878Z"
}
},
"content": {
"sbj": {
"Variant": {
"id": "test"
}
},
"ld": {
"test": [
{
"keyVal": "test"
}
]
}
}
}
jwt = "**Your JWT from the Genboree Auth Service**"
headers = {
'Content-Type': 'application/json',
'Authorization': f"Bearer {jwt}"
}
response = requests.put(url, headers=headers, json=payload)
print(response.text)
# {
# "data": {
# "msg": "Data sent successfully",
# "msgIds": [
# "(124651,0,-1,0)"
# ]
# },
# "metadata": {
# "rendered": {
# "by": "https://genboree.org/mq/brdg/srvc",
# "when": "2025-02-11T23:48:58.001Z"
# }
# },
# "status": {
# "code": 200,
# "name": "OK"
# }
# }Examples Showing Batch Submission
export JWT="Your JWT from the Genboree Auth Service"
export URL="https://genboree.org/mq/brdg/pulsar/test"
curl --location --request PUT $URL \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${JWT}" \
--data '[
{
"event": {
"type": "cg-ldh-ld-submission",
"name": "testEntity",
"uuid": "f5219414-d52d-4a9f-b15f-e9cbdc49d1a3",
"sbj": {
"id": "test_1",
"iri": "test_1"
},
"triggered": {
"by": {
"host": "https://github.com/test/",
"id": "submission_pipeline",
"iri": "https://github.com/test/submission_pipeline"
},
"at": "2024-06-05T23:38:03.878Z"
}
},
"content": {
"sbj": {
"Variant": {
"id": "test1"
}
},
"ld": {
"test": [
{
"keyVal": "test"
}
]
}
}
},
{
"event": {
"type": "cg-ldh-ld-submission",
"name": "testEntity",
"uuid": "f5219414-d52d-4a9f-b15f-e9cbdc49d1a4",
"sbj": {
"id": "test_2",
"iri": "test_2"
},
"triggered": {
"by": {
"host": "https://github.com/test/",
"id": "submission_pipeline",
"iri": "https://github.com/test/submission_pipeline"
},
"at": "2024-06-05T23:38:02.178Z"
}
},
"content": {
"sbj": {
"Variant": {
"id": "test_2"
}
},
"ld": {
"test": [
{
"keyVal": "test"
}
]
}
}
}
]'
# RESPONSE
#{
# "data": {
# "msg": "Data sent successfully",
# "msgIds": [
# "(125988,0,-1,0)",
# "(125988,1,-1,0)"
# ]
# },
# "metadata": {
# "rendered": {
# "by": "https://genboree.org/mq/brdg/srvc",
# "when": "2025-02-11T23:51:34.542Z"
# }
# },
# "status": {
# "code": 200,
# "name": "OK"
# }
#}const fetch = require("node-fetch");
const url = `https://genboree.org/mq/brdg/pulsar/test`;
const jwt = "**Your JWT from the Genboree Auth Service**";
const body = [
{
"event": {
"type": "cg-ldh-ld-submission",
"name": "testEntity",
"uuid": "f5219414-d52d-4a9f-b15f-e9cbdc49d1a3",
"sbj": {
"id": "test_1",
"iri": "test_1"
},
"triggered": {
"by": {
"host": "https://github.com/test/",
"id": "submission_pipeline",
"iri": "https://github.com/test/submission_pipeline"
},
"at": "2024-06-05T23:38:03.878Z"
}
},
"content": {
"sbj": {
"Variant": {
"id": "test1"
}
},
"ld": {
"test": [
{
"keyVal": "test"
}
]
}
}
},
{
"event": {
"type": "cg-ldh-ld-submission",
"name": "testEntity",
"uuid": "f5219414-d52d-4a9f-b15f-e9cbdc49d1a4",
"sbj": {
"id": "test2",
"iri": "test2"
},
"triggered": {
"by": {
"host": "https://github.com/test/",
"id": "submission_pipeline",
"iri": "https://github.com/test/submission_pipeline"
},
"at": "2024-06-05T23:38:02.178Z"
}
},
"content": {
"sbj": {
"Variant": {
"id": "test2"
}
},
"ld": {
"test": [
{
"keyVal": "test"
}
]
}
}
}
];
const reqConfig = {
method: "PUT",
body: JSON.stringify(body),
headers: {
Authorization: `Bearer ${jwt}`
}
};
const response = await fetch(url, reqConfig);
await response.json();
`
{
"data": {
"msg": "Data sent successfully",
"msgIds": [
"(125988,0,-1,0)",
"(125988,1,-1,0)"
]
},
"metadata": {
"rendered": {
"by": "https://genboree.org/mq/brdg/srvc",
"when": "2025-02-11T23:51:34.542Z"
}
},
"status": {
"code": 200,
"name": "OK"
}
}
`import requests
url = "https://genboree.org/mq/brdg/pulsar/test"
payload = [
{
"event": {
"type": "cg-ldh-ld-submission",
"name": "testEntity",
"uuid": "f5219414-d52d-4a9f-b15f-e9cbdc49d1a3",
"sbj": {
"id": "test_1",
"iri": "test_1"
},
"triggered": {
"by": {
"host": "https://github.com/test/",
"id": "submission_pipeline",
"iri": "https://github.com/test/submission_pipeline"
},
"at": "2024-06-05T23:38:03.878Z"
}
},
"content": {
"sbj": {
"Variant": {
"id": "test1"
}
},
"ld": {
"test": [
{
"keyVal": "test"
}
]
}
}
},
{
"event": {
"type": "cg-ldh-ld-submission",
"name": "testEntity",
"uuid": "f5219414-d52d-4a9f-b15f-e9cbdc49d1a4",
"sbj": {
"id": "test_2",
"iri": "test_2"
},
"triggered": {
"by": {
"host": "https://github.com/test/",
"id": "submission_pipeline",
"iri": "https://github.com/test/submission_pipeline"
},
"at": "2024-06-05T23:38:02.178Z"
}
},
"content": {
"sbj": {
"Variant": {
"id": "test_2"
}
},
"ld": {
"test": [
{
"keyVal": "test"
}
]
}
}
}
]
jwt = "**Your JWT from the Genboree Auth Service**"
headers = {
'Content-Type': 'application/json',
'Authorization': f"Bearer {jwt}"
}
response = requests.put(url, headers=headers, json=payload)
print(response.text)
# {
# "data": {
# "msg": "Data sent successfully",
# "msgIds": [
# "(125988,2,-1,0)",
# "(125988,3,-1,0)"
# ]
# },
# "metadata": {
# "rendered": {
# "by": "https://genboree.org/mq/brdg/srvc",
# "when": "2025-02-12T00:06:47.637Z"
# }
# },
# "status": {
# "code": 200,
# "name": "OK"
# }
# }Access Requirements
- Users must have a Genboree user account. If they do not have one they can register for one here.
- Once a user has a valid Genboree user account, they must request data submission permissions by emailing ldh-admin@bcm.edu. These permissions are environment and datatype specific.
Getting a JWT
- JWTs are issued by the Genboree Auth API Service and can be obtained by submitting a POST request to the following endpoint where the value for username is the user's Genboree account username.
https://genboree.org/auth/usr/gb:/auth
The request body should be as below where the password value is the user's Genboree account password.
{
"type": "plain",
"val": "{{password}}"
}Example Auth Service JWT Requests and Responses
export USERNAME="Your Genboree Username"
export PW="Your Genboree Password"
export URL="https://genboree.org/auth/usr/gb:${USERNAME}/auth"
curl --location "$URL" \
--data "{
\"type\": \"plain\",
\"val\": \"${PW}\"
}"
# RESPONSE
#{
# "data": {
# "jwt": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZFN0ciI6InRyZmFycmlzIiwibmFtZSI6eyJmaXJzdCI6IlRpZXJyYSIsImxhc3QiOiJGYXJyaXMifSwiaWF0IjoxNzM4NzkwNjMyLCJuYmYiOjE3Mzg3OTA2MzIsImV4cCI6MTczODg3NzAzMiwiYXVkIjoidHJmYXJyaXMiLI...(truncated)"
# },
# "metadata": {
# "rendered": {
# "by": "https://genboree.org/auth/srvc",
# "when": "2025-02-05T21:23:52.493Z"
# }
# },
# "status": {
# "code": 200,
# "name": "OK"
# }
#}const fetch = require("node-fetch");
const username = "Your Genboree Username";
const pw = "Your Genboree Password";
const url = `https://genboree.org/auth/usr/gb:${username}/auth`;
const body = {
type: "plain",
val: pw
};
const reqConfig = {
method: "POST",
body: JSON.stringify(body),
};
const response = await fetch(url, reqConfig);
await response.json()
`
{
"data": {
"jwt": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZFN0ciI6InRyZmFycmlzIiwibmFtZSI6eyJmaXJzdCI6IlRpZXJyYSIsImxhc3QiOiJGYXJyaXMifSwiaWF0IjoxNzM4NzkwNjMyLCJuYmYiOjE3Mzg3OTA2MzIsImV4cCI6MTczODg3NzAzMiwiYXVkIjoidHJmYXJyaXMiLI...(truncated)"
},
"metadata": {
"rendered": {
"by": "https://genboree.org/auth/srvc",
"when": "2025-02-05T21:23:52.493Z"
}
},
"status": {
"code": 200,
"name": "OK"
}
}
`import requests
username = 'Your Genboree Username'
url = f"https://genboree.org/auth/usr/gb:{username}/auth"
payload = {
"type": "plain",
"val": "Your Genboree Password"
}
headers = {}
response = requests.post(url, headers=headers, json=payload)
print(response.text)
{
"data": {
"jwt": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZFN0ciI6InRyZmFycmlzIiwibmFtZSI6eyJmaXJzdCI6IlRpZXJyYSIsImxhc3QiOiJGYXJyaXMifSwiaWF0IjoxNzM4NzkwNjMyLCJuYmYiOjE3Mzg3OTA2MzIsImV4cCI6MTczODg3NzAzMiwiYXVkIjoidHJmYXJyaXMiLI...(truncated)"
},
"metadata": {
"rendered": {
"by": "https://genboree.org/auth/srvc",
"when": "2025-02-05T21:23:52.493Z"
}
},
"status": {
"code": 200,
"name": "OK"
}
}Rate Limit
The rate limit policy, ie the permitted number of requests within the specified time window, is communicated to users via three header fields which are transmitted in every response. An additional Retry-After header field is also transmitted when the rate limit has been exceeded by the user.
Rate Limit Details
| Header | Header Field Value | Description |
|---|---|---|
| RateLimit-Limit | Max number of Request allowed within specified time window | The RateLimit-Limit response field indicates the request-quota associated with the client in the current time-window. If the client exceeds that limit, their request will not be served. Instead, they will receive a 429 Too Many Requests HTTP response and may retry their request after the Retry-After seconds delay has elapsed |
| RateLimit-Remaining | Number of Requests remaining for user in current time window | The RateLimit-Remaining response field indicates the remaining quota-units, i.e., requests, associated with the client. A low RateLimit-Remaining value is like a yellow traffic-light: the red light may arrive suddenly. |
| RateLimit-Reset | Time in seconds remaining for the current time window | The RateLimit-Reset response header indicates the number of seconds until the quota resets.The delay-seconds format is used because: - it does not rely on clock synchronization and is resilient to clock adjustment and clock skew between client and server - it mitigates the risk related to thundering herd when too many clients are serviced with the same timestamp. |
| Retry-After | Time user must wait before retrying request | The Retry-After header indicates how long the user should wait before making a follow-up request. Unlike the previous rate limiting headers this header will only be transmitted when the user exceeds the rate limit. When this occurs the user will receive a 429 Too Many Requests response and the Retry-After header will indicate the number of seconds until the quota resets.When present the value in the Retry-After header will be the same as the value in the RateLimit-Reset header |
Note: Although a variety of HTTP header fields are currently in use many of which use the X prefix to indicate a nonstandard header. We have chosen to implement the header fields as they are described in the IEFT Draft Spec.
Examples
Success
This is an example of the rate limiting header fields that a user can expect to receive in a successful response.
ratelimit-limit: 2500
ratelimit-remaining: 2499
ratelimit-reset: 10Rate Limit Exceeded
This is an example of the rate limiting header fields that a user can expect to receive when they have exceeded the rate limit, ie in a 429 Too Many Requests response
ratelimit-limit: 2500
ratelimit-remaining: 0
ratelimit-reset: 2
retry-after: 2Exceeding the Rate Limit
If a user exceeds the rate limit, they will receive a response with the status code 429. The 429 Too Many Requests response indicates that the user has sent too many requests in a given amount of time, ie they have exceeded the rate limit. In this case a user should make use of the Rate-Limit Reset or Retry-After headers and retry their request after the specified seconds delay.
Avoiding the Rate Limit In Scripts
Here are several tips and techniques you can employ to stay under the rate limit.
Automated Backoff
The best way to make sure you never get rate limited is to use the HTTP response headers documented above. Before your script makes another request, it can check the RateLimit-Remaining header and if it sees a 1 or 0, wait until RateLimit-Reset value has passed. You can also wait to get a 429 Too Many Requests status code, then wait the amount of time provided in the RateLimit-Reset or Retry-After headers and retry your request.
Delay/Sleep
Alternatively, it is possible to introduce a slight delay between requests. That will allow you to remain under the rate limit indefinitely and your script to run uninterrupted.
