curl --request POST \
--url https://api.grainledger.com/api/v1/donors \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "Sarah",
"lastName": "Johnson"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({firstName: 'Sarah', lastName: 'Johnson'})
};
fetch('https://api.grainledger.com/api/v1/donors', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.grainledger.com/api/v1/donors"
payload = {
"firstName": "Sarah",
"lastName": "Johnson"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"organizationName": "<string>",
"email": "<string>",
"phone": "<string>",
"donorType": "INDIVIDUAL",
"householdRef": "<string>",
"householdName": "<string>",
"householdPosition": "PRIMARY",
"isPrimaryContact": true,
"membershipStatus": "VISITOR",
"isActive": true,
"totalGiving": 123,
"contact": {
"email": "<string>",
"phone": "<string>",
"secondaryEmail": "<string>",
"secondaryPhone": "<string>",
"workPhone": "<string>",
"preferredMethod": "EMAIL"
},
"address": {
"line1": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>"
},
"profile": {
"middleName": "<string>",
"nickname": "<string>",
"title": "<string>",
"suffix": "<string>",
"birthdate": "2023-11-07T05:31:56Z",
"anniversary": "2023-11-07T05:31:56Z",
"gender": "<string>",
"isChild": true,
"grade": 123,
"graduationYear": 123,
"schoolType": "<string>",
"employer": "<string>",
"occupation": "<string>",
"photoUrl": "<string>"
},
"membership": {
"status": "<string>",
"memberSince": "2023-11-07T05:31:56Z",
"primaryCampusId": "<string>",
"inactivatedAt": "2023-11-07T05:31:56Z"
},
"communicationPreferences": {
"emailOptOut": true,
"mailOptOut": true,
"smsOptOut": true
},
"household": {
"id": "<string>",
"name": "<string>",
"primaryContactId": "<string>",
"memberCount": 123
},
"envelopeNumber": "<string>",
"defaultCurrency": "<string>",
"notes": "<string>",
"externalIds": [
{
"platform": "<string>",
"externalId": "<string>"
}
],
"giving": {
"lifetimeGiving": 123,
"giftCount": 123,
"averageGift": 123,
"firstGiftDate": "2023-11-07T05:31:56Z",
"lastGiftDate": "2023-11-07T05:31:56Z",
"segment": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization.",
"details": {
"fields": [
{
"field": "amount",
"code": "invalid_type"
}
]
}
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization.",
"details": {
"fields": [
{
"field": "amount",
"code": "invalid_type"
}
]
}
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization.",
"details": {
"fields": [
{
"field": "amount",
"code": "invalid_type"
}
]
}
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization.",
"details": {
"fields": [
{
"field": "amount",
"code": "invalid_type"
}
]
}
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization.",
"details": {
"fields": [
{
"field": "amount",
"code": "invalid_type"
}
]
}
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization.",
"details": {
"fields": [
{
"field": "amount",
"code": "invalid_type"
}
]
}
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization.",
"details": {
"fields": [
{
"field": "amount",
"code": "invalid_type"
}
]
}
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization.",
"details": {
"fields": [
{
"field": "amount",
"code": "invalid_type"
}
]
}
}Create donor
curl --request POST \
--url https://api.grainledger.com/api/v1/donors \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "Sarah",
"lastName": "Johnson"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({firstName: 'Sarah', lastName: 'Johnson'})
};
fetch('https://api.grainledger.com/api/v1/donors', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.grainledger.com/api/v1/donors"
payload = {
"firstName": "Sarah",
"lastName": "Johnson"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"organizationName": "<string>",
"email": "<string>",
"phone": "<string>",
"donorType": "INDIVIDUAL",
"householdRef": "<string>",
"householdName": "<string>",
"householdPosition": "PRIMARY",
"isPrimaryContact": true,
"membershipStatus": "VISITOR",
"isActive": true,
"totalGiving": 123,
"contact": {
"email": "<string>",
"phone": "<string>",
"secondaryEmail": "<string>",
"secondaryPhone": "<string>",
"workPhone": "<string>",
"preferredMethod": "EMAIL"
},
"address": {
"line1": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>"
},
"profile": {
"middleName": "<string>",
"nickname": "<string>",
"title": "<string>",
"suffix": "<string>",
"birthdate": "2023-11-07T05:31:56Z",
"anniversary": "2023-11-07T05:31:56Z",
"gender": "<string>",
"isChild": true,
"grade": 123,
"graduationYear": 123,
"schoolType": "<string>",
"employer": "<string>",
"occupation": "<string>",
"photoUrl": "<string>"
},
"membership": {
"status": "<string>",
"memberSince": "2023-11-07T05:31:56Z",
"primaryCampusId": "<string>",
"inactivatedAt": "2023-11-07T05:31:56Z"
},
"communicationPreferences": {
"emailOptOut": true,
"mailOptOut": true,
"smsOptOut": true
},
"household": {
"id": "<string>",
"name": "<string>",
"primaryContactId": "<string>",
"memberCount": 123
},
"envelopeNumber": "<string>",
"defaultCurrency": "<string>",
"notes": "<string>",
"externalIds": [
{
"platform": "<string>",
"externalId": "<string>"
}
],
"giving": {
"lifetimeGiving": 123,
"giftCount": 123,
"averageGift": 123,
"firstGiftDate": "2023-11-07T05:31:56Z",
"lastGiftDate": "2023-11-07T05:31:56Z",
"segment": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization.",
"details": {
"fields": [
{
"field": "amount",
"code": "invalid_type"
}
]
}
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization.",
"details": {
"fields": [
{
"field": "amount",
"code": "invalid_type"
}
]
}
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization.",
"details": {
"fields": [
{
"field": "amount",
"code": "invalid_type"
}
]
}
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization.",
"details": {
"fields": [
{
"field": "amount",
"code": "invalid_type"
}
]
}
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization.",
"details": {
"fields": [
{
"field": "amount",
"code": "invalid_type"
}
]
}
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization.",
"details": {
"fields": [
{
"field": "amount",
"code": "invalid_type"
}
]
}
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization.",
"details": {
"fields": [
{
"field": "amount",
"code": "invalid_type"
}
]
}
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization.",
"details": {
"fields": [
{
"field": "amount",
"code": "invalid_type"
}
]
}
}Authorizations
Organization API key created in Grain Settings → API. The key determines the organization and is limited to its assigned resource scopes. Write scopes imply the corresponding read scope.
Headers
Required with OAuth access tokens for resource requests. Omit only for GET /api/v1/organizations. Optional with organization API keys; if supplied with an API key, it must match the key's organization.
Body
"Sarah"
"Johnson"
"sarah@gracechurch.org"
"+15551234567"
Calendar day returned as a UTC-midnight ISO timestamp.
Calendar day returned as a UTC-midnight ISO timestamp.
MALE, FEMALE, UNSPECIFIED 1 <= x <= 121900 <= x <= 2200PUBLIC, PRIVATE, HOMESCHOOL, COLLEGE, OTHER VISITOR, REGULAR_ATTENDER, MEMBER, INACTIVE, FORMER PRIMARY, SPOUSE, CHILD, OTHER EMAIL, PHONE, MAIL Map keyed by a supported ExternalGivingSource: PUSHPAY, PLANNING_CENTER, CCB, TITHELY, SUBSPLASH, ROCK_RMS, MANUAL, or OTHER.
Hide child attributes
Hide child attributes
11111111INDIVIDUAL, HOUSEHOLD, ORGANIZATION, DAF_CUSTODIAN, FOUNDATION, ESTATE 3Response
Created donor
Stable donor profile. Identity fields are null or masked unless the caller has donor identity access.
INDIVIDUAL, HOUSEHOLD, ORGANIZATION, DAF_CUSTODIAN, FOUNDATION, ESTATE PRIMARY, SPOUSE, CHILD, OTHER VISITOR, REGULAR_ATTENDER, MEMBER, INACTIVE, FORMER Hide child attributes
Hide child attributes