Refonte AI

Project Retrieval

By using its distinct ID, the project retrieval endpoint enables you to obtain information about a particular project. Access to project-related information is available, including task count, name, status, and metadata. This endpoint can be used to integrate programmatic project management and monitoring with the refonte API. For successful access, don't forget to authenticate your queries with a working API key.

Body Params

name string required

Request

Python

POST  /v1/projects
import requests

# Replace with your actual API key
API_KEY = 'your_api_key_here'

# Define the URL for the API endpoint
url = "https://api.refonte.com/v1/projects/kitten_labeling"

# Set up the headers for the request
# Specify that we want the response in JSON format
headers = {
    "accept": "application/json" 
}

# Adding authentication to the GET request
# The auth parameter requires a tuple with
# the API key and an empty string
response = requests.get(url, headers=headers, auth=(API_KEY, ''))

# Print the response text to see the result
print(response.text)

Request

{
   "type": "imageannotation",
   "name": "kitten_labeling",
   "param_history": [
       {
       "instruction": "Instructions",
       "version": 0,
       "created_at": "2021-04-25T07:38:32.368Z"
       }
   ],
   "created_at": "2021-04-25T07:38:32.368Z"
}

List All Projects

List information for all projects. Note: No parameters required. Optionally, set a boolean value for `archived` to only list information for all (un)archived projects.

Request

Python

POST  /v1/projects
import requests
from requests.auth import HTTPBasicAuth

# URL endpoint for the API call
url = "https://api.refonte.com/v1/projects"

# Headers to specify the type of response
# we accept (JSON in this case)
headers = {"accept": "application/json"}

# Authentication using HTTP Basic Auth;
# provide your API key as the username
# No password is required, so the password field is empty
auth = HTTPBasicAuth('{{ApiKey}}', '')  

# Performing a GET request to the API
# with headers and authentication
response = requests.get(url, headers=headers, auth=auth)

# Printing the text content of the response from the API
print(response.text)

Response

{
  "type": "imageannotation",
  "name": "project_name",
  "param_history": [
    {
      "instruction": "Instructions",
      "version": 0,
      "created_at": "2021-04-25T07:38:32.368Z"
    }
  ],
  "created_at": "2021-04-25T07:38:32.368Z"
}

Create Project

You can use the Refonte.Ai API platform's project creation endpoint to create new projects programmatically. It makes it possible to manage several projects effectively, automate the development of new projects, and streamline workflows for data annotation. To properly utilize this service, you must appropriate authentication credentials (API key) and pertinent project information.

Body Params

type string required

The task type of all the tasks belonging to this project

name string required

Name identifying this project. Must be distinct from the rest of your projects. To associate a task with this project, you must include the project: ‹name› parameter in the task creation request when creating tasks for it.

rapid boolean

Whether the project being created is a Refonte.Ai Rapid project. Enterprise and On-Demand customers should omit this value.

studio boolean

Whether the project being created is a refonte Studio project. Enterprise and On-Demand customers should omit this value.

params object

The project's default settings for tasks created under it. Any values given in the task request will take precedence over any parameters specified here, if they are left out. The behavior of params.instruction is a little different; values are appended here after the task-level instruction.

pipeline string

Studio projects only. Specify the pipeline of the project. Must use either `standard_task` or `consensus_task`.

consensus_attempts integer

Studio consensus projects only. Specify the number of attempts

Request

Python

POST  /v1/projects
import requests

# Replace with your actual API key
API_KEY = 'your_api_key_here'

# Define the URL for the API endpoint
url = "https://api.refonte.com/v1/projects"

# Define the payload for creating a new project
payload = {
    "type": "imageannotation", # Type of the project
    "name": "kitten_labeling", # Name of the project
    "rapid": False,            # Indicates if the project is a rapid project
    "studio": False,           # Indicates if the project uses Refonte AI's Studio interface
    "params": { 
        # Instructions for the annotation task
        "instruction": "Please label the kittens" 
    }
}

# Set up the headers for the request
headers = {
    "accept": "application/json",      # Specify that we want the response in JSON format
    "content-type": "application/json" # Specify the content type of the request
}

# Adding authentication to the POST request
# The auth parameter requires a tuple with the API key and an empty string
response = requests.post(url, json=payload, headers=headers, auth=(API_KEY, ''))

# Print the response text to see the result
print(response.text)

Response

{
   "type": "imageannotation",
   "name": "kitten_labeling",
   "param_history": [
       {
       "instruction": "please label the kittens in the image",
       "version": 0,
       "created_at": "2021-04-25T07:38:32.368Z"
       }
    ],
   "created_at": "2021-04-25T07:38:32.368Z"
}

Update Project Parameters

On a project, parameters can be set. If project-level parameters are not specified in the task request, they will be set on all subsequent tasks created under this project. Project parameters will take a backseat to any parameters supplied in the job request.

Projects maintain a record of the initial set of settings. When a task is formed under a project, it inherits the most recent set of parameters from the project (the most recent item in param_history). However, if one wishes to forgo parameter inheritance entirely, they can provide project_version when creating a task.

Tasks have a `project_param_version` field pointing to the project version in place at the time a task was created. If you haven't already, check out our guide to using Project-level parameters to learn more about how this workflow comes togeher.

Body Params

patch boolean

When generating the newest set of project parameters, whether or not to combine the most recent project parameters with the parameters specified in this request. Defaults to false. For example, if the current params contains [ instruction: 'label the cats in the image' ] and the latest call to this API contains the task parameter [ objects_to_annotate: ['cat'] ], whether or not patch is additionally set will determine if the new project parameters also contain the instruction “label the cats in the image”. Note that any fields set in the API request completely override any fields from the previous version; object or array values will not be merged.

instruction string

Instruction field to combine with any specified task-level instruction.

any object

Default parameters for tasks created under this project. Any parameters specified here will be set if omitted in a task request; they will be overridden by any values sent in the task request.

Request

Python

POST  /v1/projects
import requests

# Replace with your actual API key
API_KEY = 'your_api_key_here'

# Define the URL for the API endpoint
url =
    "https://api.refonte.com/v1/projects/kitten_labeling/setParams"

# Define the payload to update project parameters
payload = { 
    "patch": "false"  # Parameter to be updated
}

# Set up the headers for the request
headers = {
    # Specify that we want the response in JSON format
    "accept": "application/json",
    # Specify the content type of the request
    "content-type": "application/json"
}

# Adding authentication to the POST request
# The auth parameter requires a tuple
# with the API key and an empty string
response =
    requests.post(url, json=payload, headers=headers, auth=(API_KEY, ''))

# Print the response text to see the result
print(response.text)

Response

{
"type": "imageannotation",
"pipelineName": "pipeline_name",
"numReviews": 0,
"numConsensus": 0,
"created_at": "2023-08-04T15:11:57.508Z",
"created_by": "user_id",
"created_with": "api",
"param_history": [],
"projectType": "project_type",
"name": "project_name",
"pinned": false,
"archived": false,
"nucleusDatasetId": "nucleus_id",
"customGradersUsedOrDismissed": false,
"edgeCaseAlertsEnabled": false,
"turnOnLongHints": true,
"isAudioTranscription": false,
"useOldOnboarding": false,
"containsAdultContent": false,
"useRapidSmartTraining": false,
"useTextCollectionTemplate": false,
"datasetLinks": [
{
  "datasetId": "dataset_id",
  "datasetName": "dataset_name"
}
],
"taxonomy": null,
"isSampleProject": false,
"modelEvalProject": false
}

Update Ontology (Project)

You can set ontologies on a project. Ontologies will be referenced by the tasks of a project. Projects keep a history of the ontologies they were set with.The ontology can be composed of a list of strings or `OntologyChoice` objects. Ontology choices and their subchoices must be unique throughout the ontology.

Path Params

name string required

Body Params

ontology array of strings

name string

Name identifying the version of the ontology.

Request

Python

POST  v1/projects/{Name}/setOntology
import requests

# Replace with your actual API key
API_KEY = 'your_api_key_here'

# Define the URL for the API endpoint
url =
    "https://api.refonte.com/v1/projects/kitten_labeling/setOntology"

# Define the payload to update the project's ontology
payload = { 
    "name": "ontologyName", # Name of the ontology to be set
    "ontology": [
        "ontology_string1",
        "ontology_string2",
        "ontology_string3"
    ]
}

# Set up the headers for the request
headers = {
    "content-type": "application/json" # Specify the content type of the request
}

# Adding authentication to the POST request
# The auth parameter requires a tuple
# with the API key and an empty string
response = requests.post(url, json=payload, headers=headers, auth=(API_KEY, ''))

# Print the response text to see the result
print(response.text)

Response

{
   "type": "imageannotation",
   "name": "project_name",
   "param_history": [
       {
       "instruction": "Instructions",
       "version": 0,
       "created_at": "2021-04-25T07:38:32.368Z"
       }
   ],
   "created_at": "2021-04-25T07:38:32.368Z"
}

Updated about 2 months ago