API Reference
GraphQL
GraphQL is a query language for APIs. GraphQL provides a complete and understandable description of the data in an API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.
Access
To access the Edgewise API, you'll need an access token, which you can generate from your profile (Account > API Access Tokens). Make sure to write down the access token when it is created, as we do not store it, and you will not be able to retrieve it again.
Authentication
All requests go to a single API endpoint: https://api.edgewise.io/graphql
You need to include the Authorization
header, with a Bearer [your access token]
value.
Usage
To use the GraphQL API, you can send a POST request to the API endpoint with a JSON body containing the query. All requests must be made over HTTPS using POST.
Here are some examples:
# curl: example using viewer query
curl -X POST https://api.edgewise.io/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer [your access token]" \
-d '{"query": "query Viewer { viewer { id fullName } }"}'
// javascript: example using Leads query with variables
const query = `
query Leads($filters: LeadsFilter, $first: Int) {
leads(filter: $filters, first: $first) {
id
name
email
phone
status
}
}
`
const variables = {
filters: {
status: ['NEW'],
},
first: 10,
}
fetch('https://api.edgewise.io/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer [your access token]'
},
body: JSON.stringify({ query, variables }),
})
.then(async (response) => {
const responseJson = await response.json()
})
Queries
Uses the IP address of the viewer to determine the closest city Edgewise operates in.
Returns public projects. Default is to return all projects,
sorted by Edgewise Index. You can filter by city, as well
as change the sort order. Some fields are permission restricted,
and will return null
if you (the viewer) do not have permission.
Mutations
Contact a project's sales office. This will create a lead, or merge (based on the email address).
Create a lead note. This will not notify anyone subscribed to lead note notifications.
Create the unit negotiation. Buyers cannot place an offer without having a base negotiation to assign to.
Create an organization respresentative. Necessary for enabling payments.
Create a new personalization. Personalizations are option and upgrade selections for a unit.
Create a personalization credit (eg. "Construction delay"). For percentages (eg. "10% off"), use a personalization discount.
Create a personalization discount (eg. "10% off"). For dollar amounts (eg. "Construction delay"), use a personalization credit.
Create a Stripe charge. Currently, a user can only charge themselves.
Use createPaymentIntent
instead.
Create a one-time-password (OTP) that can be used for reseting a user's password. This will send an email with a unique token that the user can use to create a new password. For security reasons, this always returns true
.
Delete an Organization's avatar image. You must have the OWNER
role on the Organization.
Swap username and password for an authentication token.
Note: token expires after 30 days. If you need a longer expiration (eg. for long-running API access),
create an AccessToken
(which has the benefit of being revokable).
Remove a member from an Organization. You must have the OWNER
role on the Organization.
Update a negotiation. Note: the negotiation status will be automatically set for accepted, rejected, and expired offers.
Update a member's role. You must have the OWNER
role on the Organization to modify another member's role.
Update your notifications for organizations for which you are a member.
Update an organization respresentative.
Update a reservation. If the status is changed to REFUNDED
, then the buyer assignment is removed, and the associated lot or unit will be marked as AVAILABLE
at the originally listed price. Note: marking a reservation as REFUNDED
does not automatically refund associated charges. Charges can be refunded using refundStripeCharge
.
Upload a floor plan elevation image. File size max is 5MB.
Upload an Organization's avatar image. File size max is 5MB. You must have the OWNER
role on the Organization.