Quickstart
This page walks through a single successful request to the CRE GraphQL API — from credentials to a parsed response.
Step 1: Obtain credentials
You need a CRE API key. See Authentication for how to create one. Creating a key requires deploy access approval.
Step 2: Identify the endpoint
https://api.cre.chain.link/graphql
Step 3: Make a request
The simplest useful request is getAccountDetails, which takes no arguments and returns the account associated with your API key.
cURL
curl -X POST \
https://api.cre.chain.link/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Apikey <CRE_API_KEY>" \
-d '{
"query": "query { getAccountDetails { memberId displayName emailAddress organizationId memberStatus } }"
}'
TypeScript
const response = await fetch("https://api.cre.chain.link/graphql", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Apikey ${process.env.CRE_API_KEY}`,
},
body: JSON.stringify({
query: `
query GetAccountDetails {
getAccountDetails {
memberId
displayName
emailAddress
organizationId
memberStatus
}
}
`,
}),
})
const result = await response.json()
console.log(result.data.getAccountDetails)
Go
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
)
type graphqlRequest struct {
Query string `json:"query"`
}
type accountDetailsResponse struct {
Data struct {
GetAccountDetails struct {
MemberID string `json:"memberId"`
DisplayName string `json:"displayName"`
EmailAddress string `json:"emailAddress"`
OrganizationID string `json:"organizationId"`
MemberStatus string `json:"memberStatus"`
} `json:"getAccountDetails"`
} `json:"data"`
}
func main() {
query := `query {
getAccountDetails {
memberId
displayName
emailAddress
organizationId
memberStatus
}
}`
body, _ := json.Marshal(graphqlRequest{Query: query})
req, _ := http.NewRequest("POST", "https://api.cre.chain.link/graphql", bytes.NewBuffer(body))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Apikey "+os.Getenv("CRE_API_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var result accountDetailsResponse
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("%+v\n", result.Data.GetAccountDetails)
}
Step 4: Inspect the response
{
"data": {
"getAccountDetails": {
"memberId": "<MEMBER_ID>",
"displayName": "Jane Doe",
"emailAddress": "jane.doe@example.com",
"organizationId": "<ORGANIZATION_ID>",
"memberStatus": "JOINED"
}
}
}
Step 5: Next steps
- Common Queries — copy-pasteable recipes for workflows, deployments, and executions
- Query Reference — every query, its arguments, and its return type
- Pagination — how to page through workflow and execution lists
- Errors & Rate Limits — how to detect and handle failures