# Submit a matrix computation job

An alternate endpoint for computing a large matrix asynchronously, where a request against the regular 
endpoint would result in a timeout.

The request format is the same, but instead of the result, you are given a job identification number that
you can use to retrieve the result once it is available.
        
In most cases, prefer the regular endpoints.

Here are some full examples via curl:
bash
$ curl -X POST -H "Content-Type: application/json" "https://graphhopper.com/api/1/matrix/calculate?key=[YOUR_KEY]" -d '{"points":[[13.29895,52.48696],[13.370876,52.489575],[13.439026,52.511206]]}'
{"job_id":"7ac65787-fb99-4e02-a832-2c3010c70097"}


Pick the returned job_id and use it in the next GET requests:
bash
$ curl -X GET "https://graphhopper.com/api/1/matrix/solution/7ac65787-fb99-4e02-a832-2c3010c70097?key=[YOUR_KEY]"
{"status":"waiting"}


When the calculation is finished (status:finished) the JSON response will contain the full matrix JSON under solution:
bash
$ curl -X GET "https://graphhopper.com/api/1/matrix/solution/7ac65787-fb99-4e02-a832-2c3010c70097?key=[YOUR_KEY]"
{"solution":{"weights":[[0.0,470.453,945.414],[503.793,0.0,580.871],[970.49,569.511,0.0]],"info":{"copyrights":["GraphHopper","OpenStreetMap contributors"]}},"status":"finished"}


Please note that if an error occured while calculation the JSON will not have a status but contain directly the error message e.g.:
json
{"message":"Cannot find from_points: 1"}

And the optional hints array.

Endpoint: POST /matrix/calculate
Version: 1.0.0
Security: key

## Response 200 fields (application/json):

  - `job_id` (string)
    UUID. Unique id for your job/request with which you can fetch your solution
    Example: "44886560-b584-4da5-b245-768151dacd8f"


