NAV
Javascript Python Ruby

Tuneup API v1

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

The Tuneup API allows you to generate text using AI with a retrieved context with your own data. This API allows you to manage collections, documents, fragments.

Client Library

We currently provide a client javascript library @tuneup/client-js.

Please note that current support for this library is limited to fragment related access only.

Language

You can use Accept-Language headers for requests to specify the language. See fragments#create for an example.

Please note that we currently support English and Japanese, although you may be able to use this on other languages. Please contact support if you need better language support.

Info

Base URLs:

Email: support

Authentication

Fragments

Operations related to manage fragments

fragments#create

Code samples

const inputBody = '{
  "input": "string",
  "search": "string",
  "model": "gpt-3.5-turbo",
  "collectionId": "0ffe69e2-b7af-4b1e-835c-867376165f50",
  "docId": "b394169a-e7cd-41ad-9e47-a6d4a11d664b",
  "output": "string",
  "isChecked": true,
  "temperature": 0
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Accept-Language':'en',
  'api-key':'API_KEY'
};

fetch('https://api.tuneup.cc/v1/fragments',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Accept-Language': 'en',
  'api-key': 'API_KEY'
}

r = requests.post('https://api.tuneup.cc/v1/fragments', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Accept-Language' => 'en',
  'api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.tuneup.cc/v1/fragments',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /v1/fragments

Create a new fragment, start text generation with AI. The response will be sent just before the text generation starts. You can use the fragment.id to request fragments#read to get a generated text.

Body parameter

{
  "input": "string",
  "search": "string",
  "model": "gpt-3.5-turbo",
  "collectionId": "0ffe69e2-b7af-4b1e-835c-867376165f50",
  "docId": "b394169a-e7cd-41ad-9e47-a6d4a11d664b",
  "output": "string",
  "isChecked": true,
  "temperature": 0
}

Parameters

Name In Type Required Description
Accept-Language header string false Specify the language of the user's request using an ISO 639-1
input body string true The input (prompt) of the fragment. Your data will be retrieved from the data source based on this input (unless search is used).
search body string false Any string to be used as a search query for your collection. This overrides input if provided. It has no effect on the prompt.
model body Model true The model you want to use for generating text.
collectionId body string(uuid) true The collection you want to use as data source. It is optional if you provide docId.
docId body string(uuid) false The document you want to generate text for. The collection will automatically be taken from this doc if specified. If you only specify collectionId, the latest doc will be used if found, or a new doc will be created. (optional)
output body string false The generated text content of the fragment. When you provide the output, text won't be generated.
isChecked body boolean false If it's false, then this fragment will not be used as a data source for the AI. It will be false right after text generation, you will need to manually update it to true if you want AI to use this fragment. Setting this to true will create the embedding and store it in the vector db.
temperature body number false The number must be between 0 and 2. Default value will be used if not given.

Enumerated Values

Parameter Value
Accept-Language en
Accept-Language ja
model gpt-3.5-turbo
model gpt-4

Example responses

202 Response

{
  "fragment": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "type": "fragment",
    "createdAt": 0,
    "input": "string",
    "output": "string",
    "isChecked": true,
    "updatingFrom": 0
  }
}

Responses

Status Meaning Description Schema
202 Accepted Fragment is created and start generating text. FragmentShow
401 Unauthorized Access token is missing or invalid None

fragments#read

Code samples


const headers = {
  'Accept':'application/json',
  'api-key':'API_KEY'
};

fetch('https://api.tuneup.cc/v1/fragments/{uuid}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'api-key': 'API_KEY'
}

r = requests.get('https://api.tuneup.cc/v1/fragments/{uuid}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-key' => 'API_KEY'
}

result = RestClient.get 'https://api.tuneup.cc/v1/fragments/{uuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

GET /v1/fragments/{uuid}

Retrieve a specific fragment by UUID

Parameters

Name In Type Required Description
uuid path string(uuid) true none

Example responses

200 Response

{
  "fragment": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "type": "fragment",
    "createdAt": 0,
    "input": "string",
    "output": "string",
    "isChecked": true,
    "updatingFrom": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation FragmentShow
401 Unauthorized Access token is missing or invalid None

fragments#update

Code samples

const inputBody = '{
  "input": "string",
  "output": "string",
  "isChecked": true
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-key':'API_KEY'
};

fetch('https://api.tuneup.cc/v1/fragments/{uuid}',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-key': 'API_KEY'
}

r = requests.post('https://api.tuneup.cc/v1/fragments/{uuid}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.tuneup.cc/v1/fragments/{uuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /v1/fragments/{uuid}

Update a specific fragment by UUID

Body parameter

{
  "input": "string",
  "output": "string",
  "isChecked": true
}

Parameters

Name In Type Required Description
uuid path string(uuid) true none
input body string false The new input content of the fragment
output body string false The new output content of the fragment. A new text will be generated when this is blank.
isChecked body boolean false The new checked status of the fragment

Example responses

200 Response

{
  "fragment": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "type": "fragment",
    "createdAt": 0,
    "input": "string",
    "output": "string",
    "isChecked": true,
    "updatingFrom": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation FragmentShow
401 Unauthorized Access token is missing or invalid None

fragments#delete

Code samples


const headers = {
  'api-key':'API_KEY'
};

fetch('https://api.tuneup.cc/v1/fragments/{uuid}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'api-key': 'API_KEY'
}

r = requests.delete('https://api.tuneup.cc/v1/fragments/{uuid}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'api-key' => 'API_KEY'
}

result = RestClient.delete 'https://api.tuneup.cc/v1/fragments/{uuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

DELETE /v1/fragments/{uuid}

Delete a specific fragment by UUID

Parameters

Name In Type Required Description
uuid path string(uuid) true none

Responses

Status Meaning Description Schema
204 No Content Successfully deleted None
401 Unauthorized Access token is missing or invalid None

Docs

Operations related to manage documents

docs#create

Code samples

const inputBody = '{
  "title": "string",
  "isImported": true,
  "externalId": "string",
  "externalCreatedAt": 0
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-key':'API_KEY'
};

fetch('https://api.tuneup.cc/v1/docs',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-key': 'API_KEY'
}

r = requests.post('https://api.tuneup.cc/v1/docs', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.tuneup.cc/v1/docs',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /v1/docs

Create a new document (doc)

Body parameter

{
  "title": "string",
  "isImported": true,
  "externalId": "string",
  "externalCreatedAt": 0
}

Parameters

Name In Type Required Description
title body string false The title of the document
isImported body boolean false True if the document is imported from a file or websites.
externalId body string false The external ID of the document. Must be unique for each collection. Usually the link (url) field of an RSS, XML is used. You can specify any string. A doc will not be created if the externalId already exists for that collection.
externalCreatedAt body number false The external creation time of the document. Usually the published (Atom) or pubDate (RSS) field is used. This is used for default sorting when retrieving documents.

Example responses

200 Response

{
  "doc": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "type": "doc",
    "createdAt": 0,
    "title": "string",
    "isImported": true,
    "externalId": "string",
    "externalCreatedAt": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation DocShow
401 Unauthorized Access token is missing or invalid None

docs#index

Code samples


const headers = {
  'Accept':'application/json',
  'api-key':'API_KEY'
};

fetch('https://api.tuneup.cc/v1/docs?collectionId=497f6eca-6276-4993-bfeb-53cbbbba6f08',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'api-key': 'API_KEY'
}

r = requests.get('https://api.tuneup.cc/v1/docs', params={
  'collectionId': '497f6eca-6276-4993-bfeb-53cbbbba6f08'
}, headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-key' => 'API_KEY'
}

result = RestClient.get 'https://api.tuneup.cc/v1/docs',
  params: {
  'collectionId' => 'string(uuid)'
}, headers: headers

p JSON.parse(result)

GET /v1/docs

Get a list of docs

Parameters

Name In Type Required Description
collectionId query string(uuid) true Specify the collection for which you want to list the documents.

Example responses

200 Response

{
  "docs": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "type": "doc",
      "createdAt": 0,
      "title": "string",
      "isImported": true,
      "externalId": "string",
      "externalCreatedAt": 0
    }
  ],
  "count": 0,
  "nextPageKey": {
    "PK": "string",
    "SK": "string",
    "createdAt": 0,
    "externalCreatedAt": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation DocsIndex
401 Unauthorized Access token is missing or invalid None

docs#read

Code samples


const headers = {
  'Accept':'application/json',
  'api-key':'API_KEY'
};

fetch('https://api.tuneup.cc/v1/docs/{uuid}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'api-key': 'API_KEY'
}

r = requests.get('https://api.tuneup.cc/v1/docs/{uuid}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-key' => 'API_KEY'
}

result = RestClient.get 'https://api.tuneup.cc/v1/docs/{uuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

GET /v1/docs/{uuid}

Retrieve a specific document by UUID. It will return all the fragments of this document.

Parameters

Name In Type Required Description
uuid path string(uuid) true none

Example responses

200 Response

{
  "doc": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "type": "doc",
    "createdAt": 0,
    "title": "string",
    "isImported": true,
    "externalId": "string",
    "externalCreatedAt": 0,
    "fragments": [
      {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "type": "fragment",
        "createdAt": 0,
        "input": "string",
        "output": "string",
        "isChecked": true,
        "updatingFrom": 0
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation DocShowWithFragments
401 Unauthorized Access token is missing or invalid None

docs#update

Code samples

const inputBody = '{
  "title": "string",
  "externalId": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-key':'API_KEY'
};

fetch('https://api.tuneup.cc/v1/docs/{uuid}',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-key': 'API_KEY'
}

r = requests.post('https://api.tuneup.cc/v1/docs/{uuid}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.tuneup.cc/v1/docs/{uuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /v1/docs/{uuid}

Update a specific doc by UUID

Body parameter

{
  "title": "string",
  "externalId": "string"
}

Parameters

Name In Type Required Description
uuid path string(uuid) true none
title body string false The new title of the doc
externalId body string false The new external ID of the doc

Example responses

200 Response

{
  "doc": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "type": "doc",
    "createdAt": 0,
    "title": "string",
    "isImported": true,
    "externalId": "string",
    "externalCreatedAt": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation DocShow
401 Unauthorized Access token is missing or invalid None

docs#delete

Code samples


const headers = {
  'api-key':'API_KEY'
};

fetch('https://api.tuneup.cc/v1/docs/{uuid}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'api-key': 'API_KEY'
}

r = requests.delete('https://api.tuneup.cc/v1/docs/{uuid}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'api-key' => 'API_KEY'
}

result = RestClient.delete 'https://api.tuneup.cc/v1/docs/{uuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

DELETE /v1/docs/{uuid}

Delete a specific doc by UUID. This operation will delete all the fragments and other associated records.

Parameters

Name In Type Required Description
uuid path string(uuid) true none

Responses

Status Meaning Description Schema
204 No Content Successfully deleted None
401 Unauthorized Access token is missing or invalid None

Collections

Operations related to manage collections

collections#create

Code samples

const inputBody = '{
  "name": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-key':'API_KEY'
};

fetch('https://api.tuneup.cc/v1/collections',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-key': 'API_KEY'
}

r = requests.post('https://api.tuneup.cc/v1/collections', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.tuneup.cc/v1/collections',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /v1/collections

Create a new collection

Body parameter

{
  "name": "string"
}

Parameters

Name In Type Required Description
name body string true The name of the collection

Example responses

200 Response

{
  "collection": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "type": "collection",
    "createdAt": 0,
    "name": "string",
    "syncUrl": "http://example.com",
    "isPartialRSS": true,
    "syncStartAt": 0,
    "template": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation CollectionShow
401 Unauthorized Access token is missing or invalid None

collections#read

Code samples


const headers = {
  'Accept':'application/json',
  'api-key':'API_KEY'
};

fetch('https://api.tuneup.cc/v1/collections/{uuid}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'api-key': 'API_KEY'
}

r = requests.get('https://api.tuneup.cc/v1/collections/{uuid}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-key' => 'API_KEY'
}

result = RestClient.get 'https://api.tuneup.cc/v1/collections/{uuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

GET /v1/collections/{uuid}

Retrieve a specific collection by UUID

Parameters

Name In Type Required Description
uuid path string(uuid) true none

Example responses

200 Response

{
  "collection": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "type": "collection",
    "createdAt": 0,
    "name": "string",
    "syncUrl": "http://example.com",
    "isPartialRSS": true,
    "syncStartAt": 0,
    "template": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation CollectionShow
401 Unauthorized Access token is missing or invalid None

collections#update

Code samples

const inputBody = '{
  "name": "string",
  "syncUrl": "http://example.com",
  "isPartialRSS": true,
  "sourceCollectionIds": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ],
  "template": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-key':'API_KEY'
};

fetch('https://api.tuneup.cc/v1/collections/{uuid}',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-key': 'API_KEY'
}

r = requests.post('https://api.tuneup.cc/v1/collections/{uuid}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.tuneup.cc/v1/collections/{uuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /v1/collections/{uuid}

Update a specific collection by UUID

Body parameter

{
  "name": "string",
  "syncUrl": "http://example.com",
  "isPartialRSS": true,
  "sourceCollectionIds": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ],
  "template": "string"
}

Parameters

Name In Type Required Description
uuid path string(uuid) true none
name body string false The new name of the collection
syncUrl body string(uri) false The new sync URL of the collection
isPartialRSS body boolean false If set to true, collections/sync will try to fetch each page as html and parse it as Doc and Fragments.
sourceCollectionIds body [string] false Array of UUIDs to specify as the source for this collection. The source collection will be referenced as the data source when text is generated with this collection.
template body string false Template for this colletion to be used as a prompt when generatin text with fragments#create or fragments#update.

Detailed descriptions

template: Template for this colletion to be used as a prompt when generatin text with fragments#create or fragments#update.

You can create unique prompt templates that guide the AI in producing text that's relevant and specific to your business or project.

There are three placeholders that you can use to further personalize the AI. Here's what each one does:

  1. {input}: This placeholder is for the title of the fragment. It designates the primary subject for the AI to comprehend and generate prompts with.
  2. {doc.title}: This placeholder refers to the title of the document which you're currently working on. Incorporate this in your template if you want the AI to consider the overall context of the document.
  3. {context}: This placeholder allows the AI to access and utilize the data that you've uploaded. Use it for the AI to generate text that's in line with your uploaded data.

Example:

"Given the topic {doc.title}, let's dive deeper into the section focusing on {input}. Pull relevant data from the following context:\n {context}\n Build a rich, informative text of {input} based on this provided data."

Example responses

200 Response

{
  "collection": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "type": "collection",
    "createdAt": 0,
    "name": "string",
    "syncUrl": "http://example.com",
    "isPartialRSS": true,
    "syncStartAt": 0,
    "template": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation CollectionShow
401 Unauthorized Access token is missing or invalid None

collections#delete

Code samples


const headers = {
  'api-key':'API_KEY'
};

fetch('https://api.tuneup.cc/v1/collections/{uuid}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'api-key': 'API_KEY'
}

r = requests.delete('https://api.tuneup.cc/v1/collections/{uuid}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'api-key' => 'API_KEY'
}

result = RestClient.delete 'https://api.tuneup.cc/v1/collections/{uuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

DELETE /v1/collections/{uuid}

Delete a specific collection by UUID. This operation will delete all the associated documents, fragments and other records.

Parameters

Name In Type Required Description
uuid path string(uuid) true none

Responses

Status Meaning Description Schema
204 No Content Successfully deleted None
401 Unauthorized Access token is missing or invalid None

collections#sync

Code samples


const headers = {
  'Accept':'application/json',
  'api-key':'API_KEY'
};

fetch('https://api.tuneup.cc/v1/collections/{uuid}/sync',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'api-key': 'API_KEY'
}

r = requests.post('https://api.tuneup.cc/v1/collections/{uuid}/sync', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.tuneup.cc/v1/collections/{uuid}/sync',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /v1/collections/{uuid}/sync

Start a sync of a specific collection by UUID. You need to set syncUrl before use.

Parameters

Name In Type Required Description
uuid path string(uuid) true none

Example responses

202 Response

{
  "collection": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "type": "collection",
    "createdAt": 0,
    "name": "string",
    "syncUrl": "http://example.com",
    "isPartialRSS": true,
    "syncStartAt": 0,
    "template": "string"
  }
}

Responses

Status Meaning Description Schema
202 Accepted Accepted, sync is started. CollectionShow
401 Unauthorized Access token is missing or invalid None

AccessTokens

Operations related to manage accessTokens

accessTokens#create

Code samples

const inputBody = '{
  "orgId": "25b2c2d5-a7fc-47d0-89e4-8709a1560bfa"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-key':'API_KEY'
};

fetch('https://api.tuneup.cc/v1/access_tokens',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-key': 'API_KEY'
}

r = requests.post('https://api.tuneup.cc/v1/access_tokens', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.tuneup.cc/v1/access_tokens',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /v1/access_tokens

Create a new access token

Body parameter

{
  "orgId": "25b2c2d5-a7fc-47d0-89e4-8709a1560bfa"
}

Parameters

Name In Type Required Description
orgId body string(uuid) true The UUID of the orginization. Authenticated user will be used as a owner of this token.

Example responses

200 Response

{
  "accessToken": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "type": "accessToken",
    "createdAt": 0,
    "token": "string",
    "domain": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation AccessTokenShow
401 Unauthorized Access token is missing or invalid None

accessTokens#update

Code samples

const inputBody = '{
  "domain": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'api-key':'API_KEY'
};

fetch('https://api.tuneup.cc/v1/access_tokens/{uuid}',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api-key': 'API_KEY'
}

r = requests.post('https://api.tuneup.cc/v1/access_tokens/{uuid}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.tuneup.cc/v1/access_tokens/{uuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /v1/access_tokens/{uuid}

Update a specific access token by UUID

Body parameter

{
  "domain": "string"
}

Parameters

Name In Type Required Description
uuid path string(uuid) true none
domain body string false Allowed domain for this access token to be used. It will allow any access if blank string is given.

Example responses

200 Response

{
  "accessToken": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "type": "accessToken",
    "createdAt": 0,
    "token": "string",
    "domain": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation AccessTokenShow
401 Unauthorized Access token is missing or invalid None

accesstokens#delete

Code samples


const headers = {
  'api-key':'API_KEY'
};

fetch('https://api.tuneup.cc/v1/access_tokens/{uuid}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'api-key': 'API_KEY'
}

r = requests.delete('https://api.tuneup.cc/v1/access_tokens/{uuid}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'api-key' => 'API_KEY'
}

result = RestClient.delete 'https://api.tuneup.cc/v1/access_tokens/{uuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

DELETE /v1/access_tokens/{uuid}

Delete an access token by UUID

Parameters

Name In Type Required Description
uuid path string(uuid) true none

Responses

Status Meaning Description Schema
204 No Content Successfully deleted None
401 Unauthorized Access token is missing or invalid None

Schemas

Id

"497f6eca-6276-4993-bfeb-53cbbbba6f08"

Properties

Name Type Required Restrictions Description
anonymous string(uuid) false none none

Timestamp

0

Milliseconds elapsed since the epoch. (Unix Time)

Properties

Name Type Required Restrictions Description
anonymous integer(number) false none Milliseconds elapsed since the epoch. (Unix Time)

Type

"collection"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous collection
anonymous doc
anonymous fragment
anonymous accessToken

Model

"gpt-3.5-turbo"

The model you want to use for generating text.

Properties

Name Type Required Restrictions Description
anonymous string false none The model you want to use for generating text.

Enumerated Values

Property Value
anonymous gpt-3.5-turbo
anonymous gpt-4

NextPageKey

{
  "PK": "string",
  "SK": "string",
  "createdAt": 0,
  "externalCreatedAt": 0
}

Keys to use for pagination. Normally you just need to pass the values returned by the API.

One of createdAt or externalCreatedAt is required. Currently only externalCreatedAt is supported for Doc.

Properties

Name Type Required Restrictions Description
PK string true none Internally used Partition Key.
SK string true none Internally used Sort Key.
createdAt Timestamp false none Milliseconds elapsed since the epoch. (Unix Time)
externalCreatedAt Timestamp false none Milliseconds elapsed since the epoch. (Unix Time)

Fragment

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "type": "fragment",
  "createdAt": 0,
  "input": "string",
  "output": "string",
  "isChecked": true,
  "updatingFrom": 0
}

Properties

Name Type Required Restrictions Description
id Id true none none
type string true none none
createdAt Timestamp true none Milliseconds elapsed since the epoch. (Unix Time)
input string false none none
output string false none none
isChecked boolean true none none
updatingFrom Timestamp false none Milliseconds elapsed since the epoch. (Unix Time)

Enumerated Values

Property Value
type fragment

FragmentShow

{
  "fragment": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "type": "fragment",
    "createdAt": 0,
    "input": "string",
    "output": "string",
    "isChecked": true,
    "updatingFrom": 0
  }
}

Properties

Name Type Required Restrictions Description
fragment Fragment false none none

Doc

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "type": "doc",
  "createdAt": 0,
  "title": "string",
  "isImported": true,
  "externalId": "string",
  "externalCreatedAt": 0
}

Properties

Name Type Required Restrictions Description
id Id false none none
type string false none none
createdAt Timestamp false none Milliseconds elapsed since the epoch. (Unix Time)
title string false none none
isImported boolean¦null false none none
externalId string¦null false none none
externalCreatedAt Timestamp false none Milliseconds elapsed since the epoch. (Unix Time)

Enumerated Values

Property Value
type doc

DocWithFragments

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "type": "doc",
  "createdAt": 0,
  "title": "string",
  "isImported": true,
  "externalId": "string",
  "externalCreatedAt": 0,
  "fragments": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "type": "fragment",
      "createdAt": 0,
      "input": "string",
      "output": "string",
      "isChecked": true,
      "updatingFrom": 0
    }
  ]
}

Properties

Name Type Required Restrictions Description
id Id false none none
type string false none none
createdAt Timestamp false none Milliseconds elapsed since the epoch. (Unix Time)
title string false none none
isImported boolean¦null false none none
externalId string¦null false none none
externalCreatedAt Timestamp false none Milliseconds elapsed since the epoch. (Unix Time)
fragments [Fragment] false none none

Enumerated Values

Property Value
type doc

DocShowWithFragments

{
  "doc": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "type": "doc",
    "createdAt": 0,
    "title": "string",
    "isImported": true,
    "externalId": "string",
    "externalCreatedAt": 0,
    "fragments": [
      {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "type": "fragment",
        "createdAt": 0,
        "input": "string",
        "output": "string",
        "isChecked": true,
        "updatingFrom": 0
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
doc DocWithFragments false none none

DocShow

{
  "doc": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "type": "doc",
    "createdAt": 0,
    "title": "string",
    "isImported": true,
    "externalId": "string",
    "externalCreatedAt": 0
  }
}

Properties

Name Type Required Restrictions Description
doc Doc false none none

DocsIndex

{
  "docs": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "type": "doc",
      "createdAt": 0,
      "title": "string",
      "isImported": true,
      "externalId": "string",
      "externalCreatedAt": 0
    }
  ],
  "count": 0,
  "nextPageKey": {
    "PK": "string",
    "SK": "string",
    "createdAt": 0,
    "externalCreatedAt": 0
  }
}

Properties

Name Type Required Restrictions Description
docs [Doc] false none none
count number false none none
nextPageKey NextPageKey false none Keys to use for pagination. Normally you just need to pass the values returned by the API.

One of createdAt or externalCreatedAt is required. Currently only externalCreatedAt is supported for Doc.

Collection

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "type": "collection",
  "createdAt": 0,
  "name": "string",
  "syncUrl": "http://example.com",
  "isPartialRSS": true,
  "syncStartAt": 0,
  "template": "string"
}

Properties

Name Type Required Restrictions Description
id Id false none none
type string false none none
createdAt Timestamp false none Milliseconds elapsed since the epoch. (Unix Time)
name string false none none
syncUrl string(uri)¦null false none none
isPartialRSS boolean¦null false none none
syncStartAt number¦null false none Timestamp of starting time of current data sync process. It will become null once the job is finished.
template string¦null false none none

Enumerated Values

Property Value
type collection

CollectionShow

{
  "collection": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "type": "collection",
    "createdAt": 0,
    "name": "string",
    "syncUrl": "http://example.com",
    "isPartialRSS": true,
    "syncStartAt": 0,
    "template": "string"
  }
}

Properties

Name Type Required Restrictions Description
collection Collection false none none

AccessToken

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "type": "accessToken",
  "createdAt": 0,
  "token": "string",
  "domain": "string"
}

Properties

Name Type Required Restrictions Description
id Id false none none
type string false none none
createdAt Timestamp false none Milliseconds elapsed since the epoch. (Unix Time)
token string false none JWT formatted access token.
domain string false none Allowed domain for this access token to be used.

Enumerated Values

Property Value
type accessToken

AccessTokenShow

{
  "accessToken": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "type": "accessToken",
    "createdAt": 0,
    "token": "string",
    "domain": "string"
  }
}

Properties

Name Type Required Restrictions Description
accessToken AccessToken false none none