# Templates

***

## Upload a template

> Upload a template to the server

```json
{"openapi":"3.1.1","info":{"title":"ByteNite developers API","version":"0.1"},"tags":[],"servers":[{"url":"https://api.bytenite.com/v1/dev"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","description":"Your ByteNite access token","name":"Authorization","in":"header"}},"schemas":{"commonGenericResponse":{"type":"object","properties":{"ok":{"type":"boolean","description":"True if the request was successful."},"requestId":{"type":"string","description":"Internal request identifier for tracing or support."},"message":{"type":"string","description":"Additional message providing status or context."},"error":{"$ref":"#/components/schemas/commonError","description":"Optional error information if the request failed."}}},"commonError":{"type":"object","properties":{"code":{"type":"integer","format":"int64","description":"Error code if the request failed."},"message":{"type":"string","description":"Short description of the error if occurred."},"description":{"type":"string","description":"Full detailed explanation of the error if applicable."}}},"rpcStatus":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/protobufAny"}}}},"protobufAny":{"type":"object","properties":{"@type":{"type":"string"}},"additionalProperties":{}},"jobJobTemplate":{"type":"object","properties":{"id":{"type":"string","title":"Unique ID for this Job Template (primary key)"},"createdAt":{"type":"string","format":"date-time","title":"Creation time of the job template"},"updatedAt":{"type":"string","format":"date-time","title":"Timestamp when the job template was last updated"},"isPublic":{"type":"boolean","title":"Indicates if this Job Template is public"},"partitioner":{"type":"string","title":"How data is partitioned"},"assembler":{"type":"string","title":"How data is assembled/merged"},"dataSource":{"$ref":"#/components/schemas/data_sourceDataSource","title":"Input data source"},"dataDestination":{"$ref":"#/components/schemas/data_sourceDataSource","title":"Output data destination"},"params":{"$ref":"#/components/schemas/jobParams","title":"Parameters for the job"},"config":{"$ref":"#/components/schemas/jobJobConfig","title":"Configuration for the job"},"userName":{"type":"string","description":"User name of the template owner."},"description":{"type":"string","title":"Description of this Job Template"},"app":{"type":"string","title":"The application associated with this Job Template"},"owner":{"type":"string","title":"Owner of this Job Template (primary key)"}},"description":"The templates specific to each app are stored in this table."},"data_sourceDataSource":{"type":"object","properties":{"dataSourceDescriptor":{"type":"string","description":"Data source selector."},"params":{"$ref":"#/components/schemas/protobufAny","description":"Data source parameters."}},"description":"The data source object specifying configurations for inputs and outputs. Please refer to the dedicated guide for detailed instructions."},"jobParams":{"type":"object","properties":{"partitioner":{"type":"object"},"app":{"type":"object"},"assembler":{"type":"object"}},"title":"Parameters holds the parameters for the job"},"jobJobConfig":{"type":"object","properties":{"taskTimeout":{"type":"integer","format":"int64","title":"task timeout in seconds"},"jobTimeout":{"type":"integer","format":"int64","title":"job timeout in seconds"},"isTestJob":{"type":"boolean","title":"'true' if this job is a test job"},"maxTaskRetries":{"type":"integer","format":"int64","title":"Maximum number of retries for each task in the job"}}}}},"paths":{"/templates":{"post":{"summary":"Upload a template","description":"Upload a template to the server","operationId":"Developer_UploadTemplate","responses":{"200":{"description":"A successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/commonGenericResponse"}},"application/x-protobuf":{"schema":{"$ref":"#/components/schemas/commonGenericResponse"}}}},"400":{"description":"Returned when the users sends a malformed request.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"401":{"description":"Returned when the user is not authenticated.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"403":{"description":"Returned when the user does not have permission to access the resource.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"404":{"description":"Returned when the resource does not exist.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"500":{"description":"Returned when an error on the server occurred.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"503":{"description":"Returned when the resource is temporarily unavailable.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"default":{"description":"An unexpected error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rpcStatus"}},"application/x-protobuf":{"schema":{"$ref":"#/components/schemas/rpcStatus"}}}}},"tags":["templates"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/jobJobTemplate"}},"application/x-protobuf":{"schema":{"$ref":"#/components/schemas/jobJobTemplate"}}},"description":"The templates specific to each app are stored in this table.","required":true}}}}}
```

***

## Get a template

> Get a template by id

```json
{"openapi":"3.1.1","info":{"title":"ByteNite developers API","version":"0.1"},"tags":[],"servers":[{"url":"https://api.bytenite.com/v1/dev"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","description":"Your ByteNite access token","name":"Authorization","in":"header"}},"schemas":{"jobJobTemplate":{"type":"object","properties":{"id":{"type":"string","title":"Unique ID for this Job Template (primary key)"},"createdAt":{"type":"string","format":"date-time","title":"Creation time of the job template"},"updatedAt":{"type":"string","format":"date-time","title":"Timestamp when the job template was last updated"},"isPublic":{"type":"boolean","title":"Indicates if this Job Template is public"},"partitioner":{"type":"string","title":"How data is partitioned"},"assembler":{"type":"string","title":"How data is assembled/merged"},"dataSource":{"$ref":"#/components/schemas/data_sourceDataSource","title":"Input data source"},"dataDestination":{"$ref":"#/components/schemas/data_sourceDataSource","title":"Output data destination"},"params":{"$ref":"#/components/schemas/jobParams","title":"Parameters for the job"},"config":{"$ref":"#/components/schemas/jobJobConfig","title":"Configuration for the job"},"userName":{"type":"string","description":"User name of the template owner."},"description":{"type":"string","title":"Description of this Job Template"},"app":{"type":"string","title":"The application associated with this Job Template"},"owner":{"type":"string","title":"Owner of this Job Template (primary key)"}},"description":"The templates specific to each app are stored in this table."},"data_sourceDataSource":{"type":"object","properties":{"dataSourceDescriptor":{"type":"string","description":"Data source selector."},"params":{"$ref":"#/components/schemas/protobufAny","description":"Data source parameters."}},"description":"The data source object specifying configurations for inputs and outputs. Please refer to the dedicated guide for detailed instructions."},"protobufAny":{"type":"object","properties":{"@type":{"type":"string"}},"additionalProperties":{}},"jobParams":{"type":"object","properties":{"partitioner":{"type":"object"},"app":{"type":"object"},"assembler":{"type":"object"}},"title":"Parameters holds the parameters for the job"},"jobJobConfig":{"type":"object","properties":{"taskTimeout":{"type":"integer","format":"int64","title":"task timeout in seconds"},"jobTimeout":{"type":"integer","format":"int64","title":"job timeout in seconds"},"isTestJob":{"type":"boolean","title":"'true' if this job is a test job"},"maxTaskRetries":{"type":"integer","format":"int64","title":"Maximum number of retries for each task in the job"}}},"rpcStatus":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/protobufAny"}}}}}},"paths":{"/templates/{id}":{"get":{"summary":"Get a template","description":"Get a template by id","operationId":"Developer_GetTemplateById","responses":{"200":{"description":"A successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/jobJobTemplate"}},"application/x-protobuf":{"schema":{"$ref":"#/components/schemas/jobJobTemplate"}}}},"400":{"description":"Returned when the users sends a malformed request.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"401":{"description":"Returned when the user is not authenticated.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"403":{"description":"Returned when the user does not have permission to access the resource.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"404":{"description":"Returned when the resource does not exist.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"500":{"description":"Returned when an error on the server occurred.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"503":{"description":"Returned when the resource is temporarily unavailable.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"default":{"description":"An unexpected error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rpcStatus"}},"application/x-protobuf":{"schema":{"$ref":"#/components/schemas/rpcStatus"}}}}},"parameters":[{"schema":{"type":"string"},"name":"id","in":"path","required":true}],"tags":["templates"]}}}}
```

***

## Get templates

> List all templates created by the user

```json
{"openapi":"3.1.1","info":{"title":"ByteNite developers API","version":"0.1"},"tags":[],"servers":[{"url":"https://api.bytenite.com/v1/dev"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","description":"Your ByteNite access token","name":"Authorization","in":"header"}},"schemas":{"developerTemplateListResponse":{"type":"object","properties":{"templates":{"type":"array","items":{"$ref":"#/components/schemas/jobJobTemplate"}},"pagination":{"$ref":"#/components/schemas/commonPaginatedResponse"}}},"jobJobTemplate":{"type":"object","properties":{"id":{"type":"string","title":"Unique ID for this Job Template (primary key)"},"createdAt":{"type":"string","format":"date-time","title":"Creation time of the job template"},"updatedAt":{"type":"string","format":"date-time","title":"Timestamp when the job template was last updated"},"isPublic":{"type":"boolean","title":"Indicates if this Job Template is public"},"partitioner":{"type":"string","title":"How data is partitioned"},"assembler":{"type":"string","title":"How data is assembled/merged"},"dataSource":{"$ref":"#/components/schemas/data_sourceDataSource","title":"Input data source"},"dataDestination":{"$ref":"#/components/schemas/data_sourceDataSource","title":"Output data destination"},"params":{"$ref":"#/components/schemas/jobParams","title":"Parameters for the job"},"config":{"$ref":"#/components/schemas/jobJobConfig","title":"Configuration for the job"},"userName":{"type":"string","description":"User name of the template owner."},"description":{"type":"string","title":"Description of this Job Template"},"app":{"type":"string","title":"The application associated with this Job Template"},"owner":{"type":"string","title":"Owner of this Job Template (primary key)"}},"description":"The templates specific to each app are stored in this table."},"data_sourceDataSource":{"type":"object","properties":{"dataSourceDescriptor":{"type":"string","description":"Data source selector."},"params":{"$ref":"#/components/schemas/protobufAny","description":"Data source parameters."}},"description":"The data source object specifying configurations for inputs and outputs. Please refer to the dedicated guide for detailed instructions."},"protobufAny":{"type":"object","properties":{"@type":{"type":"string"}},"additionalProperties":{}},"jobParams":{"type":"object","properties":{"partitioner":{"type":"object"},"app":{"type":"object"},"assembler":{"type":"object"}},"title":"Parameters holds the parameters for the job"},"jobJobConfig":{"type":"object","properties":{"taskTimeout":{"type":"integer","format":"int64","title":"task timeout in seconds"},"jobTimeout":{"type":"integer","format":"int64","title":"job timeout in seconds"},"isTestJob":{"type":"boolean","title":"'true' if this job is a test job"},"maxTaskRetries":{"type":"integer","format":"int64","title":"Maximum number of retries for each task in the job"}}},"commonPaginatedResponse":{"type":"object","properties":{"total":{"type":"integer","format":"int64","description":"The total number of transactions available."},"offset":{"type":"integer","format":"int64","description":"The starting position of the current page of results, starting from 0."},"hasPrevious":{"type":"boolean","description":"A boolean value (True/False) indicating whether there's a previous page of results. False if the current page is the first page."},"hasNext":{"type":"boolean","description":"A boolean value indicating whether there's a next page of results."}},"description":"This section provides information about how the results are divided into pages."},"rpcStatus":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/protobufAny"}}}}}},"paths":{"/templates":{"get":{"summary":"Get templates","description":"List all templates created by the user","operationId":"Developer_GetTemplates","responses":{"200":{"description":"A successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/developerTemplateListResponse"}},"application/x-protobuf":{"schema":{"$ref":"#/components/schemas/developerTemplateListResponse"}}}},"400":{"description":"Returned when the users sends a malformed request.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"401":{"description":"Returned when the user is not authenticated.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"403":{"description":"Returned when the user does not have permission to access the resource.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"404":{"description":"Returned when the resource does not exist.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"500":{"description":"Returned when an error on the server occurred.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"503":{"description":"Returned when the resource is temporarily unavailable.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"default":{"description":"An unexpected error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rpcStatus"}},"application/x-protobuf":{"schema":{"$ref":"#/components/schemas/rpcStatus"}}}}},"parameters":[{"schema":{"type":"string"},"name":"orderBy","description":"Field name to sort apps by (e.g., createdAt).","in":"query","required":false},{"schema":{"type":"integer","format":"int64"},"name":"pagination.limit","description":"Number of rows to return per page.","in":"query","required":false},{"schema":{"type":"integer","format":"int64"},"name":"pagination.offset","description":"Number of rows to skip before starting to collect the result set.","in":"query","required":false},{"schema":{"type":"boolean"},"name":"isPublic","description":"Filter public templates only","in":"query","required":false}],"tags":["templates"]}}}}
```
