Create an inbound file upload
curl --request POST \
--url https://api.matrices.com/v1/agents/{agentId}/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contentType": "<string>",
"head": "aSDinaTvuI8gbWludGxpZnk=",
"id": "<string>",
"size": 13107200,
"name": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contentType: '<string>',
head: 'aSDinaTvuI8gbWludGxpZnk=',
id: '<string>',
size: 13107200,
name: '<string>'
})
};
fetch('https://api.matrices.com/v1/agents/{agentId}/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.matrices.com/v1/agents/{agentId}/files"
payload = {
"contentType": "<string>",
"head": "aSDinaTvuI8gbWludGxpZnk=",
"id": "<string>",
"size": 13107200,
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.matrices.com/v1/agents/{agentId}/files"
payload := strings.NewReader("{\n \"contentType\": \"<string>\",\n \"head\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"id\": \"<string>\",\n \"size\": 13107200,\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"block": {
"text": "<string>",
"type": "text"
},
"upload": {
"expiresAt": "2023-11-07T05:31:56Z",
"headers": {
"contentType": "<string>",
"ifNoneMatch": "*"
},
"url": "<string>"
}
}{
"error": "<string>",
"message": "<string>",
"attemptsRemaining": 123,
"code": "<string>",
"retryAfterSeconds": 123
}{
"error": "<string>",
"message": "<string>",
"attemptsRemaining": 123,
"code": "<string>",
"retryAfterSeconds": 123
}{
"error": "<string>",
"message": "<string>",
"attemptsRemaining": 123,
"code": "<string>",
"retryAfterSeconds": 123
}{
"error": "<string>",
"message": "<string>",
"attemptsRemaining": 123,
"code": "<string>",
"retryAfterSeconds": 123
}{
"error": "<string>",
"message": "<string>",
"attemptsRemaining": 123,
"code": "<string>",
"retryAfterSeconds": 123
}Files
Create an inbound file upload
Classifies one source-delivered file from its declared metadata and leading bytes, then returns the message block and, when the object is absent, a short-lived conditional PUT grant. A readable image the agent’s model accepts becomes an image block; every other file becomes a file block. Send exactly the declared size and every returned header unchanged. The URL is a bearer and must not be logged, persisted, or shared. Repeating the request for an already stored object returns the same block without an upload grant.
POST
/
v1
/
agents
/
{agentId}
/
files
Create an inbound file upload
curl --request POST \
--url https://api.matrices.com/v1/agents/{agentId}/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contentType": "<string>",
"head": "aSDinaTvuI8gbWludGxpZnk=",
"id": "<string>",
"size": 13107200,
"name": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contentType: '<string>',
head: 'aSDinaTvuI8gbWludGxpZnk=',
id: '<string>',
size: 13107200,
name: '<string>'
})
};
fetch('https://api.matrices.com/v1/agents/{agentId}/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.matrices.com/v1/agents/{agentId}/files"
payload = {
"contentType": "<string>",
"head": "aSDinaTvuI8gbWludGxpZnk=",
"id": "<string>",
"size": 13107200,
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.matrices.com/v1/agents/{agentId}/files"
payload := strings.NewReader("{\n \"contentType\": \"<string>\",\n \"head\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"id\": \"<string>\",\n \"size\": 13107200,\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"block": {
"text": "<string>",
"type": "text"
},
"upload": {
"expiresAt": "2023-11-07T05:31:56Z",
"headers": {
"contentType": "<string>",
"ifNoneMatch": "*"
},
"url": "<string>"
}
}{
"error": "<string>",
"message": "<string>",
"attemptsRemaining": 123,
"code": "<string>",
"retryAfterSeconds": 123
}{
"error": "<string>",
"message": "<string>",
"attemptsRemaining": 123,
"code": "<string>",
"retryAfterSeconds": 123
}{
"error": "<string>",
"message": "<string>",
"attemptsRemaining": 123,
"code": "<string>",
"retryAfterSeconds": 123
}{
"error": "<string>",
"message": "<string>",
"attemptsRemaining": 123,
"code": "<string>",
"retryAfterSeconds": 123
}{
"error": "<string>",
"message": "<string>",
"attemptsRemaining": 123,
"code": "<string>",
"retryAfterSeconds": 123
}Authorizations
Body
application/json