n8n-nodes-starter/credentials/AutosendApi.credentials.ts
Claude 2f1ffde4a5
Add Autosend node with Mail and Contact resources
Implement n8n node for Autosend API with support for:
- Mail resource: Send single and bulk emails with template or custom content
- Contact resource: Create/update contacts (upsert) and get contacts by ID or email
- API key authentication
- Declarative routing following n8n best practices
- Full TypeScript support with proper typing
- Passing all linting checks
2025-11-11 17:56:01 +00:00

53 lines
1,013 B
TypeScript

import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class AutosendApi implements ICredentialType {
name = 'autosendApi';
displayName = 'Autosend API';
documentationUrl = 'https://docs.autosend.com/';
icon = 'file:../icons/autosend.svg' as const;
httpRequestNode = {
name: 'Autosend',
docsUrl: 'https://docs.autosend.com/',
apiBaseUrl: 'https://api.autosend.com/',
};
properties: INodeProperties[] = [
{
displayName: 'API Key',
name: 'apiKey',
type: 'string',
typeOptions: {
password: true,
},
default: '',
required: true,
description: 'API key from your Autosend account settings',
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
Authorization: '=Bearer {{$credentials.apiKey}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: 'https://api.autosend.com',
url: '/contacts',
method: 'GET',
},
};
}